#1475
Cunoscând numărul n de numere, precum şi cele n numere naturale pe care le primeşte Victor, ajutaţi-l să calculeze corect suma cifrelor impare din mijlocul fiecărui număr citit.
Olimpiada Municipala Informatica Iasi 2016
| Problema | Numere14 | Operații I/O |
numere14.in/numere14.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
| Id soluție | #63360089 | Utilizator | |
| Fișier | numere14.cpp | Dimensiune | 459 B |
| Data încărcării | 27 Februarie 2026, 17:43 | Scor/rezultat | Eroare de compilare |
numere14.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout("numere14.out") ^ numere14.cpp: In function 'int main()': numere14.cpp:9:10: error: 'n' was not declared in this scope fin>>n; ^ numere14.cpp:10:9: error: 'i' was not declared in this scope for(i=1; i<=n;i++) ^ numere14.cpp:11:14: error: 'x' was not declared in this scope fin<<x; ^ numere14.cpp:12:5: error: 'nc' was not declared in this scope nc=0;x2=x; ^ numere14.cpp:12:10: error: 'x2' was not declared in this scope nc=0;x2=x; ^ numere14.cpp:12:13: error: 'x' was not declared in this scope nc=0;x2=x; ^ numere14.cpp:13:16: error: 'whie' was not declared in this scope whie (x2!=0) ^ numere14.cpp:14:5: error: expected ';' before '{' token { ^ numere14.cpp:18:5: error: 'p' was not declared in this scope p=0; ^ numere14.cpp:21:11: error: 'c' was not declared in this scope p++; c=x%10; ^ numere14.cpp:23:13: error: 's' was not declared in this scope s=s+c; ^ numere14.cpp:26:5: error: 'fout' was not declared in this scope fout<<s; ^ numere14.cpp:26:11: error: 's' was not declared in this scope fout<<s; ^ numere14.cpp: At global scope: numere14.cpp:28:5: error: expected unqualified-id before 'return' return 0; ^ numere14.cpp:29:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere14 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ă.