#1013
Aniversari
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 | #54018553 | Utilizator | |
Fișier | aniversari.cpp | Dimensiune | 557 B |
Data încărcării | 18 Noiembrie 2024, 08:35 | Scor / rezultat | Eroare de compilare |
aniversari.cpp:6:1: error: expected ';' after struct definition } int a[1001]; ^ aniversari.cpp: In function 'int main()': aniversari.cpp:9:21: error: 'n' was not declared in this scope for (int i=1;i<=n;i++) ^ aniversari.cpp:11:19: error: request for member 'an' in 'a[i]', which is of non-class type 'int' cin>>a[i].an>>a[i].luna>>a[i].zi; ^ aniversari.cpp:11:28: error: request for member 'luna' in 'a[i]', which is of non-class type 'int' cin>>a[i].an>>a[i].luna>>a[i].zi; ^ aniversari.cpp:11:39: error: request for member 'zi' in 'a[i]', which is of non-class type 'int' cin>>a[i].an>>a[i].luna>>a[i].zi; ^ aniversari.cpp:12:14: error: request for member 'poz' in 'a[i]', which is of non-class type 'int' a[i].poz=i; ^ aniversari.cpp:14:20: error: 'n' was not declared in this scope for(int i=1;i<=n-1;i++) ^ aniversari.cpp:18:14: error: request for member 'an' in 'a[i]', which is of non-class type 'int' if(a[i].an>a[j].an) ^ aniversari.cpp:18:22: error: request for member 'an' in 'a[j]', which is of non-class type 'int' if(a[i].an>a[j].an) ^ aniversari.cpp:20:19: error: request for member 'an' in 'a[i]', which is of non-class type 'int' else if(a[i].an==a[j].an) ^ aniversari.cpp:20:28: error: request for member 'an' in 'a[j]', which is of non-class type 'int' else if(a[i].an==a[j].an) ^ aniversari.cpp:21:17: error: request for member 'luna' in 'a[i]', which is of non-class type 'int' if(a[i].luna>a[j].luna) ^ aniversari.cpp:21:27: error: request for member 'luna' in 'a[j]', which is of non-class type 'int' if(a[i].luna>a[j].luna) ^ aniversari.cpp:23:22: error: request for member 'zi' in 'a[i]', which is of non-class type 'int' else if(a[i].zi>a[j].zi) ^ aniversari.cpp:23:30: error: request for member 'zi' in 'a[j]', which is of non-class type 'int' else if(a[i].zi>a[j].zi) ^ aniversari.cpp:20:13: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] else if(a[i].an==a[j].an) ^ aniversari.cpp:27:11: error: 'v' was not declared in this scope cout<<v[n].poz<<" "<<v[1].poz; ^ aniversari.cpp:27:13: error: 'n' was not declared in this scope cout<<v[n].poz<<" "<<v[1].poz; ^
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ă.