#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 | #64782037 | Utilizator | |
| Fișier | varste_copii.cpp | Dimensiune | 365 B |
| Data încărcării | 30 Mai 2026, 15:18 | Scor/rezultat | Eroare de compilare |
varste_copii.cpp: In function ‘int main()’: varste_copii.cpp:8:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 8 | if ( a > b ) | ^~ varste_copii.cpp:9:58: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 9 | cout << "Primul copil este mai mare cu" << a - b; << " ani"; | ^~ varste_copii.cpp:9:58: error: expected primary-expression before ‘<<’ token varste_copii.cpp:10:5: error: ‘else’ without a previous ‘if’ 10 | else if ( b - a ) | ^~~~ varste_copii.cpp:10:10: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 10 | else if ( b - a ) | ^~ varste_copii.cpp:11:63: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 11 | cout << " Al doilea copil este mai mare cu" << b - a; " ani "; | ^~~~~~~ varste_copii.cpp:11:63: warning: statement has no effect [-Wunused-value] varste_copii.cpp:12:9: error: ‘else’ without a previous ‘if’ 12 | else | ^~~~
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ă.