#3063
Scrieți un program care citește un număr natural nenul n și care afișează numele lunii calendaristice corespunzătoare numărului n.
| Problema | luna | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64398533 | Utilizator | |
| Fișier | luna.cpp | Dimensiune | 643 B |
| Data încărcării | 05 Mai 2026, 10:24 | Scor/rezultat | Eroare de compilare |
luna.cpp: In function ‘int main()’: luna.cpp:9:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 9 | if (a==1)cout<<"ianuarie";break; | ^~ luna.cpp:9:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 9 | if (a==1)cout<<"ianuarie";break; | ^~~~~ luna.cpp:9:31: error: break statement not within loop or switch luna.cpp:10:12: error: expected ‘(’ before ‘else’ 10 | if else (a==2)cout<<"februarie";break; | ^~~~ | ( luna.cpp:10:41: error: break statement not within loop or switch 10 | if else (a==2)cout<<"februarie";break; | ^~~~~ luna.cpp:11:12: error: expected ‘(’ before ‘else’ 11 | if else(a==3)cout<<"martie";break; | ^~~~ | ( luna.cpp:11:37: error: break statement not within loop or switch 11 | if else(a==3)cout<<"martie";break; | ^~~~~ luna.cpp:12:12: error: expected ‘(’ before ‘else’ 12 | if else (a==4)cout<<"aprilie";break; | ^~~~ | ( luna.cpp:12:39: error: break statement not within loop or switch 12 | if else (a==4)cout<<"aprilie";break; | ^~~~~ luna.cpp:13:12: error: expected ‘(’ before ‘else’ 13 | if else(a==5)cout<<"mai";break; | ^~~~ | ( luna.cpp:13:34: error: break statement not within loop or switch 13 | if else(a==5)cout<<"mai";break; | ^~~~~ luna.cpp:14:12: error: expected ‘(’ before ‘else’ 14 | if else(a==6)cout<<"iunie";break; | ^~~~ | ( luna.cpp:14:36: error: break statement not within loop or switch 14 | if else(a==6)cout<<"iunie";break; | ^~~~~ luna.cpp:15:12: error: expected ‘(’ before ‘else’ 15 | if else(a==7)cout<<"iulie";break; | ^~~~ | ( luna.cpp:15:36: error: break statement not within loop or switch 15 | if else(a==7)cout<<"iulie";break; | ^~~~~ luna.cpp:16:12: error: expected ‘(’ before ‘else’ 16 | if else(a==8)cout<<"august";break; | ^~~~ | ( luna.cpp:16:37: error: break statement not within loop or switch 16 | if else(a==8)cout<<"august";break; | ^~~~~ luna.cpp:17:12: error: expected ‘(’ before ‘else’ 17 | if else(a==9)cout<<"septembrie";break; | ^~~~ | ( luna.cpp:17:41: error: break statement not within loop or switch 17 | if else(a==9)cout<<"septembrie";break; | ^~~~~ luna.cpp:18:12: error: expected ‘(’ before ‘else’ 18 | if else(a==10)cout<<"octombrie";break; | ^~~~ | ( luna.cpp:18:41: error: break statement not within loop or switch 18 | if else(a==10)cout<<"octombrie";break; | ^~~~~ luna.cpp:19:12: error: expected ‘(’ before ‘else’ 19 | if else(a==11)cout<<"noiembrie";break; | ^~~~ | ( luna.cpp:19:41: error: break statement not within loop or switch 19 | if else(a==11)cout<<"noiembrie";break; | ^~~~~ luna.cpp:20:12: error: expected ‘(’ before ‘else’ 20 | if else(a=12)cout<<"decembrie";break; | ^~~~ | ( luna.cpp:20:40: error: break statement not within loop or switch 20 | if else(a=12)cout<<"decembrie";break; | ^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema luna 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ă.