Borderou de evaluare (job #3145009)
Utilizator | Data | 11 august 2023 22:21:35 | |
---|---|---|---|
Problema | Geometry | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In constructor 'Line::Line(Point, Point)':
main.cpp:66:46: error: no matching function for call to 'gcd(short int, int&)'
66 | int aux = gcd(gcd(a, b), c);
| ~~~^~~~~~~~~~~~~~
main.cpp:43:3: note: candidate: 'template<class T> T gcd(T, T)'
43 | T gcd(T a, T b){
| ^~~
main.cpp:43:3: note: template argument deduction/substitution failed:
main.cpp:66:46: note: deduced conflicting types for parameter 'T' ('short int' and 'int')
66 | int aux = gcd(gcd(a, b), c);
| ~~~^~~~~~~~~~~~~~
main.cpp: In function 'Point Intersection(Line, Line)':
main.cpp:99:52: warning: narrowing conversion of '(((d2.Line::c * ((int)d1.Line::b)) - (d1.Line::c * ((int)d2.Line::b))) / ((((int)d1.Line::a) * ((int)d2.Line::b)) - (((int)d2.Line::a) * ((int)d1.Line::b))))' from 'int' to 'short int' [-Wnarrowing]
99 | Point Intersec{(d2.c * d1.b - d1.c * d2.b) / (d1.a * d2.b - d2.a * d1.b),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:100:52: warning: narrowing conversion of '(((d2.Line::c * ((int)d1.Line::a)) - (d1.Line::c * ((int)d2.Line::a))) / ((((int)d1.Line::b) * ((int)d2.Line::a)) - (((int)d2.Line::b) * ((int)d1.Line::a))))' from 'int' to 'short int' [-Wnarrowing]
100 | (d2.c * d1.a - d1.c * d2.a) / (d1.b * d2.a - d2.b * d1.a)};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp: In instantiation of 'T gcd(T, T) [with T = short int]':
main.cpp:66:22: required from here
main.cpp:46:19: error: no matching function for call to 'gcd(short int&, int)'
46 | return gcd(b, a % b);
| ~~~^~~~~~~~~~
main.cpp:43:3: note: candidate: 'template<class T> T gcd(T, T)'
43 | T gcd(T a, T b){
| ^~~
main.cpp:43:3: note: template argument deduction/substitution failed:
main.cpp:46:19: note: deduced conflicting types for parameter 'T' ('short int' and 'int')
46 | return gcd(b, a % b);
| ~~~^~~~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !