#3063
luna
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 | #17238737 | Utilizator | |
Fișier | luna.cpp | Dimensiune | 608 B |
Data încărcării | 04 Octombrie 2019, 18:47 | Scor / rezultat | Eroare de compilare |
luna.cpp: In function 'int main()': luna.cpp:11:9: error: case label '1' not within a switch statement case 1 cout<<"ianuarie";break; ^ luna.cpp:11:16: error: expected ':' before 'cout' case 1 cout<<"ianuarie";break; ^ luna.cpp:11:33: error: break statement not within loop or switch case 1 cout<<"ianuarie";break; ^ luna.cpp:12:9: error: case label '2' not within a switch statement case 2 cout<<"februarie";break; ^ luna.cpp:12:16: error: expected ':' before 'cout' case 2 cout<<"februarie";break; ^ luna.cpp:12:34: error: break statement not within loop or switch case 2 cout<<"februarie";break; ^ luna.cpp:13:9: error: case label '3' not within a switch statement case 3 cout<<"martie";break; ^ luna.cpp:13:16: error: expected ':' before 'cout' case 3 cout<<"martie";break; ^ luna.cpp:13:31: error: break statement not within loop or switch case 3 cout<<"martie";break; ^ luna.cpp:14:9: error: case label '4' not within a switch statement case 4 cout<<"aprilie";break; ^ luna.cpp:14:16: error: expected ':' before 'cout' case 4 cout<<"aprilie";break; ^ luna.cpp:14:32: error: break statement not within loop or switch case 4 cout<<"aprilie";break; ^ luna.cpp:15:9: error: case label '5' not within a switch statement case 5 cout<<"mai";break; ^ luna.cpp:15:16: error: expected ':' before 'cout' case 5 cout<<"mai";break; ^ luna.cpp:15:28: error: break statement not within loop or switch case 5 cout<<"mai";break; ^ luna.cpp:16:9: error: case label '6' not within a switch statement case 6 cout<<"iunie";break; ^ luna.cpp:16:16: error: expected ':' before 'cout' case 6 cout<<"iunie";break; ^ luna.cpp:16:30: error: break statement not within loop or switch case 6 cout<<"iunie";break; ^ luna.cpp:17:9: error: case label '7' not within a switch statement case 7 cout<<"iulie";break; ^ luna.cpp:17:16: error: expected ':' before 'cout' case 7 cout<<"iulie";break; ^ luna.cpp:17:30: error: break statement not within loop or switch case 7 cout<<"iulie";break; ^ luna.cpp:18:9: error: case label '8' not within a switch statement case 8 cout<<"august";break; ^ luna.cpp:18:16: error: expected ':' before 'cout' case 8 cout<<"august";break; ^ luna.cpp:18:31: error: break statement not within loop or switch case 8 cout<<"august";break; ^ luna.cpp:19:9: error: case label '9' not within a switch statement case 9 cout<<"septembrie";break; ^ luna.cpp:19:16: error: expected ':' before 'cout' case 9 cout<<"septembrie";break; ^ luna.cpp:19:35: error: break statement not within loop or switch case 9 cout<<"septembrie";break; ^ luna.cpp:20:9: error: case label '10' not within a switch statement case 10 cout<<"octombrie";break; ^ luna.cpp:20:17: error: expected ':' before 'cout' case 10 cout<<"octombrie";break; ^ luna.cpp:20:35: error: break statement not within loop or switch case 10 cout<<"octombrie";break; ^ luna.cpp:21:9: error: case label '11' not within a switch statement case 11 cout<<"noiembrie";break; ^ luna.cpp:21:17: error: expected ':' before 'cout' case 11 cout<<"noiembrie";break; ^ luna.cpp:21:35: error: break statement not within loop or switch case 11 cout<<"noiembrie";break; ^ luna.cpp:22:9: error: case label '12' not within a switch statement case 12 cout<<"decembrie";break; ^ luna.cpp:22:17: error: expected ':' before 'cout' case 12 cout<<"decembrie";break; ^ luna.cpp:22:35: error: break statement not within loop or switch case 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ă.