#3275
Se dau 3 numere naturale, fiecare având câte două cifre. Afișați-le pe acelea care au suma cifrelor maximă.
CNFB - Concurs de pregatire, clasa a 5-a
| Problema | nrSumCifMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64321470 | Utilizator | |
| Fișier | nrsumcifmax.cpp | Dimensiune | 326 B |
| Data încărcării | 29 Aprilie 2026, 15:23 | Scor/rezultat | Eroare de compilare |
nrsumcifmax.cpp: In function ‘int main()’: nrsumcifmax.cpp:8:16: error: overloaded function with no contextual type information 8 | max=x%10+x/10; | ^~ nrsumcifmax.cpp:9:17: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator>’ 9 | if(y%10+y/10>max); | ~~~~~~~~~^~~~ nrsumcifmax.cpp:9:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 9 | if(y%10+y/10>max); | ^~ nrsumcifmax.cpp:10:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 10 | max=y%10+y/10; | ^~~ nrsumcifmax.cpp:10:20: error: overloaded function with no contextual type information 10 | max=y%10+y/10; | ^~ nrsumcifmax.cpp:11:18: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator>’ 11 | if(z%10+z/10>max); | ~~~~~~~~~^~~~ nrsumcifmax.cpp:11:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if(z%10+z/10>max); | ^~ nrsumcifmax.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 12 | max=z%10+z/10; | ^~~ nrsumcifmax.cpp:12:20: error: overloaded function with no contextual type information 12 | max=z%10+z/10; | ^~ nrsumcifmax.cpp:14:12: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator==’ 14 | if(max==y%10+y/10); | ~~~^~~~~~~~~~~ nrsumcifmax.cpp:16:12: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator==’ 16 | if(max==z%10+z/10); | ~~~^~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nrSumCifMax face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.