Detalii evaluare #52871675

Rezumat problemă

Se dă un şir cu cel mult 255 de caractere. Să se determine câte vocale conţine.

Se va defini şi utiliza subprogramul apcar, cu doi parametri:

  • s – un şir cu cel mult 255 de caractere
  • c – un caracter

care returnează numărul de apariţii ale caracterului c în şirul s.

Detalii

Problema NrVocale1 Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #52871675 Utilizator Matei Gaidargi (CristianoRonaldo_1)
Fișier nrvocale1.cpp Dimensiune 563 B
Data încărcării 11 Octombrie 2024, 11:53 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

nrvocale1.cpp:12:9: error: stray '\342' in program
         if (s[i]==‘a’ or s[i]==‘e’ or s[i]==‘i’ or s[i]==‘o’ or s[i]==‘u’)

         ^
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\230' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\231' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\230' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\231' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\230' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\231' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\230' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\231' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\230' in program
nrvocale1.cpp:12:9: error: stray '\342' in program
nrvocale1.cpp:12:9: error: stray '\200' in program
nrvocale1.cpp:12:9: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
       if (s[i-1]!=‘a’ && s[i-1]!=‘e’ && s[i-1]!=‘i’ && s[i-1]!=‘o’ && s[i-1]!=‘u’ && s[i-1]!=’ ‘)

       ^
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\230' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\230' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\230' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\230' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\230' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\231' in program
nrvocale1.cpp:13:7: error: stray '\342' in program
nrvocale1.cpp:13:7: error: stray '\200' in program
nrvocale1.cpp:13:7: error: stray '\230' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
 if (s[i+1]!=‘a’ && s[i+1]!=‘e’ && s[i+1]!=‘i’ && s[i+1]!=‘o’ && s[i+1]!=‘u’ && s[i+1]!=’ ‘)

 ^
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\230' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\231' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\230' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\231' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\230' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\231' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\230' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\231' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\230' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\231' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\231' in program
nrvocale1.cpp:14:1: error: stray '\342' in program
nrvocale1.cpp:14:1: error: stray '\200' in program
nrvocale1.cpp:14:1: error: stray '\230' in program
nrvocale1.cpp: In function 'int main()':
nrvocale1.cpp:6:26: error: 's' was not declared in this scope
 { char s270; cin.getline(s,270);

                          ^
nrvocale1.cpp:12:22: error: 'a' was not declared in this scope
         if (s[i]==‘a’ or s[i]==‘e’ or s[i]==‘i’ or s[i]==‘o’ or s[i]==‘u’)

                      ^
nrvocale1.cpp:12:39: error: 'e' was not declared in this scope
         if (s[i]==‘a’ or s[i]==‘e’ or s[i]==‘i’ or s[i]==‘o’ or s[i]==‘u’)

                                       ^
nrvocale1.cpp:12:73: error: 'o' was not declared in this scope
         if (s[i]==‘a’ or s[i]==‘e’ or s[i]==‘i’ or s[i]==‘o’ or s[i]==‘u’)

                                                                         ^
nrvocale1.cpp:12:90: error: 'u' was not declared in this scope
         if (s[i]==‘a’ or s[i]==‘e’ or s[i]==‘i’ or s[i]==‘o’ or s[i]==‘u’)

                                                                                          ^
nrvocale1.cpp:13:121: error: expected primary-expression before ')' token
       if (s[i-1]!=‘a’ && s[i-1]!=‘e’ && s[i-1]!=‘i’ && s[i-1]!=‘o’ && s[i-1]!=‘u’ && s[i-1]!=’ ‘)

                                                                                                                         ^
nrvocale1.cpp:14:115: error: expected primary-expression before ')' token
 if (s[i+1]!=‘a’ && s[i+1]!=‘e’ && s[i+1]!=‘i’ && s[i+1]!=‘o’ && s[i+1]!=‘u’ && s[i+1]!=’ ‘)

                                                                                                                   ^
nrvocale1.cpp:6:8: warning: unused variable 's270' [-Wunused-variable]
 { char s270; cin.getline(s,270);

        ^
nrvocale1.cpp:9:10: warning: unused variable 'consoana' [-Wunused-variable]
 int k=0, consoana=0, v=-1,c=-1; 

          ^
nrvocale1.cpp:9:22: warning: unused variable 'v' [-Wunused-variable]
 int k=0, consoana=0, v=-1,c=-1; 

                      ^
nrvocale1.cpp:9:27: warning: unused variable 'c' [-Wunused-variable]
 int k=0, consoana=0, v=-1,c=-1; 

                           ^

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