Borderou de evaluare (job #3203690)
Utilizator | Data | 14 februarie 2024 10:43:01 | |
---|---|---|---|
Problema | Algoritmul lui Euclid extins | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int euclid(int, int, int&, int&)':
main.cpp:16:13: error: declaration of 'int y' shadows a parameter
16 | int x0, y, d;
| ^
main.cpp:9:39: note: 'int& y' previously declared here
9 | int euclid(int a, int b, int& x, int& y) {
| ~~~~~^
main.cpp:17:28: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
17 | d = euclid(b, a%b, x0, y0);
| ^~
| |
| double (*)(double) noexcept
main.cpp:9:39: note: initializing argument 4 of 'int euclid(int, int, int&, int&)'
9 | int euclid(int a, int b, int& x, int& y) {
| ~~~~~^
main.cpp:17:28: error: cannot bind rvalue '(int)y0' to 'int&'
17 | d = euclid(b, a%b, x0, y0);
| ^~
main.cpp:19:9: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
19 | x = y0;
| ^~
| |
| double (*)(double) noexcept
main.cpp:20:20: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator*'
20 | y = x0 - (a/b) * y0;
| ~~~~~ ^ ~~
| | |
| int double(double) noexcept
main.cpp: In function 'int main()':
main.cpp:28:31: error: 'x' was not declared in this scope
28 | auto d = euclid(a, b, x, y);
| ^
main.cpp:28:34: error: 'y' was not declared in this scope
28 | auto d = euclid(a, b, x, y);
| ^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !