#972
Se dă un șir de caractere. Să se determine câte vocale din șir sunt cuprinse între două consoane.
| Problema | Pozitii | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64799461 | Utilizator | |
| Fișier | pozitii.cpp | Dimensiune | 4.70 KB |
| Data încărcării | 02 Iunie 2026, 09:50 | Scor/rezultat | Eroare de compilare |
pozitii.cpp: In function ‘int main()’: pozitii.cpp:41:47: error: ‘struct elev’ has no member named ‘varsta’ 41 | fin>>v[i].abs>>v[i].med>>v[i].varsta; | ^~~~~~ pozitii.cpp:43:34: error: ‘struct elev’ has no member named ‘clasa’ 43 | fin.getline(v[i].clasa, 5); | ^~~~~ pozitii.cpp:50:74: error: ‘struct elev’ has no member named ‘varsta’ 50 | cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<endl; | ^~~~~~ pozitii.cpp:50:92: error: ‘struct elev’ has no member named ‘clasa’ 50 | cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<endl; | ^~~~~ pozitii.cpp:65:91: error: ‘struct elev’ has no member named ‘varsta’ 65 | for (i=1; i<=n; i++) cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<endl; | ^~~~~~ pozitii.cpp:65:109: error: ‘struct elev’ has no member named ‘clasa’ 65 | for (i=1; i<=n; i++) cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<endl; | ^~~~~ pozitii.cpp:77:23: error: ‘struct elev’ has no member named ‘varsta’ 77 | cin>>v[n].varsta; | ^~~~~~ pozitii.cpp:79:23: error: ‘struct elev’ has no member named ‘clasa’ 79 | cin>>v[n].clasa; | ^~~~~ pozitii.cpp:81:70: error: ‘struct elev’ has no member named ‘varsta’ 81 | cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<" "<<endl; | ^~~~~~ pozitii.cpp:81:88: error: ‘struct elev’ has no member named ‘clasa’ 81 | cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<" "<<endl; | ^~~~~ pozitii.cpp:95:60: error: ‘struct elev’ has no member named ‘clasa’ 95 | if (strcmp(v[i].nume, name)==0 and strcmp(v[i].clasa, cl)==0) | ^~~~~ pozitii.cpp:108:26: error: ‘struct elev’ has no member named ‘varsta’ 108 | v[i].varsta=v[i+1].varsta; | ^~~~~~ pozitii.cpp:108:40: error: ‘struct elev’ has no member named ‘varsta’ 108 | v[i].varsta=v[i+1].varsta; | ^~~~~~ pozitii.cpp:109:33: error: ‘struct elev’ has no member named ‘clasa’ 109 | strcpy(v[i].clasa, v[i+1].clasa); | ^~~~~ pozitii.cpp:109:47: error: ‘struct elev’ has no member named ‘clasa’ 109 | strcpy(v[i].clasa, v[i+1].clasa); | ^~~~~ pozitii.cpp:113:74: error: ‘struct elev’ has no member named ‘varsta’ 113 | cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<endl; | ^~~~~~ pozitii.cpp:113:92: error: ‘struct elev’ has no member named ‘clasa’ 113 | cout<<v[i].nume<<" "<<v[i].abs<<" "<<v[i].med<<" "<<v[i].varsta<<" "<<v[i].clasa<<endl; | ^~~~~ pozitii.cpp:119:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 119 | for (i=1; i<=50; i++) cout<<c;cout<<endl; | ^~~ pozitii.cpp:119:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 119 | for (i=1; i<=50; i++) cout<<c;cout<<endl; | ^~~~ pozitii.cpp:121:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 121 | for (i=1; i<=50; i++) cout<<c; cout<<endl; | ^~~ pozitii.cpp:121:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 121 | for (i=1; i<=50; i++) cout<<c; cout<<endl; | ^~~~ pozitii.cpp:124:48: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 124 | cout<<c<<v[i].nume; for (j=1; j<=25-strlen(v[i].nume); j++) cout<<" "; | ~^~~~~~~~~~~~~~~~~~~~~~ pozitii.cpp:125:31: error: ‘struct elev’ has no member named ‘clasa’ 125 | cout<<c<<v[i].clasa; for (j=1; j<=11-strlen(v[i].clasa); j++) cout<<" "; | ^~~~~ pozitii.cpp:125:66: error: ‘struct elev’ has no member named ‘clasa’ 125 | cout<<c<<v[i].clasa; for (j=1; j<=11-strlen(v[i].clasa); j++) cout<<" "; | ^~~~~ pozitii.cpp:126:31: error: ‘struct elev’ has no member named ‘varsta’ 126 | cout<<c<<v[i].varsta; for (j=1; j<=8; j++) cout<<" "; | ^~~~~~ pozitii.cpp:129:13: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 129 | for (i=1; i<=50; i++) cout<<c; cout<<endl; | ^~~ pozitii.cpp:129:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 129 | for (i=1; i<=50; i++) cout<<c; cout<<endl; | ^~~~ pozitii.cpp:21:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | system("cls"); | ~~~~~~^~~~~~~ pozitii.cpp:136:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | system("pause"); | ~~~~~~^~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Pozitii 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ă.