#2004
ore
Se consideră două evenimente a căror durată este exprimată fiecare prin câte trei numere naturale: ore (h
), minute (m
) şi secunde (s
). Să se scrie în fișierul de ieșire: a) pe primele două linii, duratele în formatul h: m: s
; b) pe următoarele două linii, duratele exprimate în secunde, corespunzătoare fiecărui eveniment, pe rânduri separate; c) pe următoarea linie suma obţinută din adunarea duratelor celor două evenimente, exprimată în ore, minute, secunde, în formatul h: m: s
.
Subiecte Atestat Informatica - Bucuresti
Problema | ore | Operații I/O |
ore.in /ore.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54174673 | Utilizator | |
Fișier | ore.cpp | Dimensiune | 686 B |
Data încărcării | 21 Noiembrie 2024, 12:16 | Scor / rezultat | Eroare de compilare |
ore.cpp:4:1: error: 'iftream' does not name a type iftream cin("ore.in"); ^ ore.cpp:10:1: error: expected ';' after struct definition } int l1,l2,l; ^ ore.cpp: In function 'int main()': ore.cpp:14:5: error: 'cin' was not declared in this scope cin>>l1.h>>l1.m>>l1.s; ^ ore.cpp:14:13: error: request for member 'h' in 'l1', which is of non-class type 'int' cin>>l1.h>>l1.m>>l1.s; ^ ore.cpp:14:19: error: request for member 'm' in 'l1', which is of non-class type 'int' cin>>l1.h>>l1.m>>l1.s; ^ ore.cpp:14:25: error: request for member 's' in 'l1', which is of non-class type 'int' cin>>l1.h>>l1.m>>l1.s; ^ ore.cpp:15:13: error: request for member 'h' in 'l2', which is of non-class type 'int' cin>>l2.h>>l2.m>>l2.s; ^ ore.cpp:15:19: error: request for member 'm' in 'l2', which is of non-class type 'int' cin>>l2.h>>l2.m>>l2.s; ^ ore.cpp:15:25: error: request for member 's' in 'l2', which is of non-class type 'int' cin>>l2.h>>l2.m>>l2.s; ^ ore.cpp:17:14: error: request for member 'h' in 'l1', which is of non-class type 'int' cout<<l1.h<<": "<<l1.m<<": "<<l1.s<<endl; ^ ore.cpp:17:26: error: request for member 'm' in 'l1', which is of non-class type 'int' cout<<l1.h<<": "<<l1.m<<": "<<l1.s<<endl; ^ ore.cpp:17:38: error: request for member 's' in 'l1', which is of non-class type 'int' cout<<l1.h<<": "<<l1.m<<": "<<l1.s<<endl; ^ ore.cpp:18:14: error: request for member 'h' in 'l2', which is of non-class type 'int' cout<<l2.h<<": "<<l2.m<<": "<<l2.s<<endl; ^ ore.cpp:18:26: error: request for member 'm' in 'l2', which is of non-class type 'int' cout<<l2.h<<": "<<l2.m<<": "<<l2.s<<endl; ^ ore.cpp:18:38: error: request for member 's' in 'l2', which is of non-class type 'int' cout<<l2.h<<": "<<l2.m<<": "<<l2.s<<endl; ^ ore.cpp:20:11: error: request for member 'h' in 'l1', which is of non-class type 'int' r1=l1.h*3600+l1.m*60+l1.s; ^ ore.cpp:20:21: error: request for member 'm' in 'l1', which is of non-class type 'int' r1=l1.h*3600+l1.m*60+l1.s; ^ ore.cpp:20:29: error: request for member 's' in 'l1', which is of non-class type 'int' r1=l1.h*3600+l1.m*60+l1.s; ^ ore.cpp:21:11: error: request for member 'h' in 'l2', which is of non-class type 'int' r2=l2.h*3600+l2.m*60+l2.s; ^ ore.cpp:21:21: error: request for member 'm' in 'l2', which is of non-class type 'int' r2=l2.h*3600+l2.m*60+l2.s; ^ ore.cpp:21:29: error: request for member 's' in 'l2', which is of non-class type 'int' r2=l2.h*3600+l2.m*60+l2.s; ^ ore.cpp:24:7: error: request for member 's' in 'l', which is of non-class type 'int' l.s=l1.s+l2.s; ^ ore.cpp:24:12: error: request for member 's' in 'l1', which is of non-class type 'int' l.s=l1.s+l2.s; ^ ore.cpp:24:17: error: request for member 's' in 'l2', which is of non-class type 'int' l.s=l1.s+l2.s; ^ ore.cpp:25:7: error: request for member 'm' in 'l', which is of non-class type 'int' l.m=l1.m+l2.m; ^ ore.cpp:25:12: error: request for member 'm' in 'l1', which is of non-class type 'int' l.m=l1.m+l2.m; ^ ore.cpp:25:17: error: request for member 'm' in 'l2', which is of non-class type 'int' l.m=l1.m+l2.m; ^ ore.cpp:26:7: error: request for member 'h' in 'l', which is of non-class type 'int' l.h=l1.h+l2.h; ^ ore.cpp:26:12: error: request for member 'h' in 'l1', which is of non-class type 'int' l.h=l1.h+l2.h; ^ ore.cpp:26:17: error: request for member 'h' in 'l2', which is of non-class type 'int' l.h=l1.h+l2.h; ^ ore.cpp:27:10: error: request for member 's' in 'l', which is of non-class type 'int' if(l.s>60) ^ ore.cpp:29:11: error: request for member 's' in 'l', which is of non-class type 'int' l.s=l.s-60; ^ ore.cpp:29:15: error: request for member 's' in 'l', which is of non-class type 'int' l.s=l.s-60; ^ ore.cpp:30:11: error: request for member 'm' in 'l', which is of non-class type 'int' l.m=l.m+1; ^ ore.cpp:30:15: error: request for member 'm' in 'l', which is of non-class type 'int' l.m=l.m+1; ^ ore.cpp:32:10: error: request for member 'm' in 'l', which is of non-class type 'int' if(l.m>60) ^ ore.cpp:33:13: error: request for member 'm' in 'l', which is of non-class type 'int' { l.m=l.m-60; ^ ore.cpp:33:17: error: request for member 'm' in 'l', which is of non-class type 'int' { l.m=l.m-60; ^ ore.cpp:34:9: error: request for member 'h' in 'l', which is of non-class type 'int' l.h=l.h+1; ^ ore.cpp:34:13: error: request for member 'h' in 'l', which is of non-class type 'int' l.h=l.h+1; ^ ore.cpp:36:13: error: request for member 'h' in 'l', which is of non-class type 'int' cout<<l.h<<": "<<l.m<<": "<<l.s; ^ ore.cpp:36:24: error: request for member 'm' in 'l', which is of non-class type 'int' cout<<l.h<<": "<<l.m<<": "<<l.s; ^ ore.cpp:36:35: error: request for member 's' in 'l', which is of non-class type 'int' cout<<l.h<<": "<<l.m<<": "<<l.s; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ore 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ă.