#1013
Se dau datele de naștere a n persoane, numerotate de la 1 la n, în forma an luna zi. Să se determine numărul de ordine al celei mai tinere și al celei mai în vârstă persoană dintre cele date.
| Problema | Aniversari | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64106430 | Utilizator | |
| Fișier | aniversari.cpp | Dimensiune | 1.12 KB |
| Data încărcării | 17 Aprilie 2026, 10:50 | Scor/rezultat | 0 puncte |
aniversari.cpp: In function ‘int main()’: aniversari.cpp:26:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 26 | if ( x.an = mx.an ) | ~~~~~^~~~~~~ aniversari.cpp:29:33: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 29 | if ( x.luna = mx.luna ) | ~~~~~~~^~~~~~~~~ aniversari.cpp:26:16: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 26 | if ( x.an = mx.an ) | ^ aniversari.cpp:35:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 35 | if ( x.an = mn.an ) | ~~~~~^~~~~~~ aniversari.cpp:38:33: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 38 | if ( x.luna = mn.luna ) | ~~~~~~~^~~~~~~~~ aniversari.cpp:35:16: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 35 | if ( x.an = mn.an ) | ^ aniversari.cpp:45:22: warning: ‘tanar’ may be used uninitialized [-Wmaybe-uninitialized] 45 | cout << tanar << ' ' << batran << '\n'; | ^~~ aniversari.cpp:20:9: note: ‘tanar’ was declared here 20 | int tanar, batran; | ^~~~~ aniversari.cpp:45:39: warning: ‘batran’ may be used uninitialized [-Wmaybe-uninitialized] 45 | cout << tanar << ' ' << batran << '\n'; | ^~~~ aniversari.cpp:20:16: note: ‘batran’ was declared here 20 | int tanar, batran; | ^~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Aniversari 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ă.