Detalii evaluare #64398416

Rezumat problemă

#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.

Detalii

Problema luna Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64398416 Utilizator plugaru MATEI (mateiplugaru)
Fișier luna.cpp Dimensiune 597 B
Data încărcării 05 Mai 2026, 10:22 Scor/rezultat Eroare de compilare

Evaluare

Mesaj 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:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   10 |         if (a==2)cout<<"februarie";break;
      |         ^~
luna.cpp:10:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   10 |         if (a==2)cout<<"februarie";break;
      |                                    ^~~~~
luna.cpp:10:36: error: break statement not within loop or switch
luna.cpp:11:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   11 |         if (a==3)cout<<"martie";break;
      |         ^~
luna.cpp:11:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   11 |         if (a==3)cout<<"martie";break;
      |                                 ^~~~~
luna.cpp:11:33: error: break statement not within loop or switch
luna.cpp:12:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   12 |         if (a==4)cout<<"aprilie";break;
      |         ^~
luna.cpp:12:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   12 |         if (a==4)cout<<"aprilie";break;
      |                                  ^~~~~
luna.cpp:12:34: error: break statement not within loop or switch
luna.cpp:13:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   13 |         if (a==5)cout<<"mai";break;
      |         ^~
luna.cpp:13:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   13 |         if (a==5)cout<<"mai";break;
      |                              ^~~~~
luna.cpp:13:30: error: break statement not within loop or switch
luna.cpp:14:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   14 |         if (a==6)cout<<"iunie";break;
      |         ^~
luna.cpp:14:32: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   14 |         if (a==6)cout<<"iunie";break;
      |                                ^~~~~
luna.cpp:14:32: error: break statement not within loop or switch
luna.cpp:15:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   15 |         if (a==7)cout<<"iulie";break;
      |         ^~
luna.cpp:15:32: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   15 |         if (a==7)cout<<"iulie";break;
      |                                ^~~~~
luna.cpp:15:32: error: break statement not within loop or switch
luna.cpp:16:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   16 |         if (a==8)cout<<"august";break;
      |         ^~
luna.cpp:16:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   16 |         if (a==8)cout<<"august";break;
      |                                 ^~~~~
luna.cpp:16:33: error: break statement not within loop or switch
luna.cpp:17:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   17 |         if (a==9)cout<<"septembrie";break;
      |         ^~
luna.cpp:17:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   17 |         if (a==9)cout<<"septembrie";break;
      |                                     ^~~~~
luna.cpp:17:37: error: break statement not within loop or switch
luna.cpp:18:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   18 |         if (a==10)cout<<"octombrie";break;
      |         ^~
luna.cpp:18:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   18 |         if (a==10)cout<<"octombrie";break;
      |                                     ^~~~~
luna.cpp:18:37: error: break statement not within loop or switch
luna.cpp:19:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   19 |         if (a==11)cout<<"noiembrie";break;
      |         ^~
luna.cpp:19:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   19 |         if (a==11)cout<<"noiembrie";break;
      |                                     ^~~~~
luna.cpp:19:37: error: break statement not within loop or switch
luna.cpp:20:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   20 |         if (a=12)cout<<"decembrie";break;
      |             ~^~~
luna.cpp:20:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   20 |         if (a=12)cout<<"decembrie";break;
      |         ^~
luna.cpp:20:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   20 |         if (a=12)cout<<"decembrie";break;
      |                                    ^~~~~
luna.cpp:20:36: error: break statement not within loop or switch

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema luna face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.

Du-te sus!