#2004
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 | #63459707 | Utilizator | |
| Fișier | ore.cpp | Dimensiune | 1.19 KB |
| Data încărcării | 04 Martie 2026, 12:08 | Scor/rezultat | Eroare de compilare |
ore.cpp:38:2: error: expected unqualified-id before numeric constant }1460 ^ ore.cpp:43:12: error: redefinition of 'std::ifstream in' ifstream in("ore.in"); ^ ore.cpp:5:10: error: 'std::ifstream in' previously declared here ifstream in("serbare.in"); ^ ore.cpp:44:13: error: redefinition of 'std::ofstream out' ofstream out("ore.out"); ^ ore.cpp:6:10: error: 'std::ofstream out' previously declared here ofstream out("serbare.out"); ^ ore.cpp:48:14: error: conflicting declaration 'eveniment a [3]' eveniment a[3]; ^ ore.cpp:10:10: error: 'a' has a previous declaration as 'uniforma a [1001]' uniforma a[1001]; ^ ore.cpp: In function 'int main()': ore.cpp:49:5: error: redefinition of 'int main()' int main() ^ ore.cpp:11:5: error: 'int main()' previously defined here int main() ^ ore.cpp:53:18: error: 'struct uniforma' has no member named 'h' in>>a[i].h>>a[i].m>>a[i].s; ^ ore.cpp:53:26: error: 'struct uniforma' has no member named 'm' in>>a[i].h>>a[i].m>>a[i].s; ^ ore.cpp:53:34: error: 'struct uniforma' has no member named 's' in>>a[i].h>>a[i].m>>a[i].s; ^ ore.cpp:57:19: error: 'struct uniforma' has no member named 'h' out<<a[i].h<<": "<<a[i].m<<": "<<a[i].s; ^ ore.cpp:57:33: error: 'struct uniforma' has no member named 'm' out<<a[i].h<<": "<<a[i].m<<": "<<a[i].s; ^ ore.cpp:57:47: error: 'struct uniforma' has no member named 's' out<<a[i].h<<": "<<a[i].m<<": "<<a[i].s; ^ ore.cpp:63:14: error: 'struct uniforma' has no member named 'l' a[i].l=a[i].h3600+a[i].m60+a[i].s; ^ ore.cpp:63:21: error: 'struct uniforma' has no member named 'h3600' a[i].l=a[i].h3600+a[i].m60+a[i].s; ^ ore.cpp:63:32: error: 'struct uniforma' has no member named 'm60' a[i].l=a[i].h3600+a[i].m60+a[i].s; ^ ore.cpp:63:41: error: 'struct uniforma' has no member named 's' a[i].l=a[i].h3600+a[i].m60+a[i].s; ^ ore.cpp:64:19: error: 'struct uniforma' has no member named 'l' out<<a[i].l; ^ ore.cpp:68:16: error: 'struct uniforma' has no member named 'l' lT=a[1].l+a[2].l; ^ ore.cpp:68:23: error: 'struct uniforma' has no member named 'l' lT=a[1].l+a[2].l; ^
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ă.