#833
Fiind date vârstele a doi copii afișați care dintre ei este cel mai mare și cu cât.
| Problema | Varste copii | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64997118 | Utilizator | |
| Fișier | varste_copii.cpp | Dimensiune | 355 B |
| Data încărcării | 08 Iulie 2026, 19:07 | Scor/rezultat | Eroare de compilare |
varste_copii.cpp: In function ‘int main()’: varste_copii.cpp:9:5: error: ‘x’ was not declared in this scope 9 | x=a-b; | ^ varste_copii.cpp:8:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 8 | if (a>b) | ^~ varste_copii.cpp:10:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 10 | cout << Primul copil este mai mare cu << " "<<x <<" "<<ani ; | ^~~~ varste_copii.cpp:10:13: error: ‘Primul’ was not declared in this scope 10 | cout << Primul copil este mai mare cu << " "<<x <<" "<<ani ; | ^~~~~~ varste_copii.cpp:11:5: error: ‘else’ without a previous ‘if’ 11 | else if (a==b) | ^~~~ varste_copii.cpp:12:6: error: ‘x’ was not declared in this scope 12 | x=0 | ^ varste_copii.cpp:15:6: error: ‘x’ was not declared in this scope 15 | x=a-b; | ^ varste_copii.cpp:14:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 14 | if (b>a) | ^~ varste_copii.cpp:16:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 16 | cout << Al doilea copil este mai mare cu << " "<<x <<" "<<ani ; | ^~~~ varste_copii.cpp:16:14: error: ‘Al’ was not declared in this scope 16 | cout << Al doilea copil este mai mare cu << " "<<x <<" "<<ani ; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Varste copii 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ă.