#275
PerechiVocale1
Se dă un text în care cuvintele sunt formate din litere mici ale alfabetului englez şi cifre şi sunt separate prin spaţii şi semne de punctuaţie. Să se determine perechea de vocale alăturate din text care apare de cele mai multe ori.
Variante Bacalaureat 2009
Problema | PerechiVocale1 | Operații I/O |
perechivocale1.in /perechivocale1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54159583 | Utilizator | |
Fișier | perechivocale1.cpp | Dimensiune | 1000 B |
Data încărcării | 21 Noiembrie 2024, 08:04 | Scor / rezultat | Eroare de compilare |
perechivocale1.cpp:1:21: warning: extra tokens at end of #include directive [enabled by default] #include <iostream> #include <cstring> #include <fstream> using namespace std; ifstream fin("perechivocale1.in"); ofstream fout("perechivocale1.out"); int f[26]; char s[41],voc[6],vocale[3]; int i,j,maxu; char* x[25]; int main() { strcpy(x[1],"ae"); strcpy(x[0],"aa"); strcpy(x[2],"ai");strcpy(x[3],"ao");strcpy(x[4],"au");strcpy(x[5],"ea");strcpy(x[6],"ee");strcpy(x[7],"ei");strcpy(x[8],"eo");strcpy(x[9],"eu");strcpy(x[10],"ia"); strcpy(x[11],"ie");strcpy(x[12],"ii");strcpy(x[13],"io");strcpy(x[14],"iu");strcpy(x[15],"oa");strcpy(x[16],"oe");strcpy(x[17],"oi");strcpy(x[18],"oo");strcpy(x[19],"ou"); strcpy(x[20],"ua");strcpy(x[21],"ue");strcpy(x[22],"ui");strcpy(x[23],"uo");strcpy(x[24],"uu"); strcpy(voc,"aeiou"); while(fin>>s) { for(i=0;i<strlen(s)-1;i++) { if(strchr(voc,s[i])!=NULL && strchr(voc,s[i+1])!=NULL) { vocale[0]=s[i]; vocale[1]=s[i+1]; vocale[2]='\0'; for(j=0;j<25;j++) { if(strcmp(vocale,x[i])==0) { f[i]++; } } } } } for(i=0;i<25;i++) { if(maxu<f[i]) maxu=f[i]; } for(i=0;i<25 ^ /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 21 has invalid symbol index 22 /usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2 /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function \`_start': (.text+0x18): undefined reference to \`main' collect2: error: ld returned 1 exit status
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PerechiVocale1 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ă.