#801
EliminareSpatii
Să se scrie un program care citeşte un şir de caractere format din cuvinte separate prin unul sau mai multe spații şi elimină din șir toate spațiile inutile.
Variante Bacalaureat 2013
Problema | EliminareSpatii | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53936650 | Utilizator | |
Fișier | eliminarespatii.cpp | Dimensiune | 408 B |
Data încărcării | 15 Noiembrie 2024, 10:34 | Scor / rezultat | Eroare de compilare |
eliminarespatii.cpp:12:5: error: stray '\342' in program while ( ch[0]==’ ‘) {strcpy (ch,ch+1)} ^ eliminarespatii.cpp:12:5: error: stray '\200' in program eliminarespatii.cpp:12:5: error: stray '\231' in program eliminarespatii.cpp:12:5: error: stray '\342' in program eliminarespatii.cpp:12:5: error: stray '\200' in program eliminarespatii.cpp:12:5: error: stray '\230' in program eliminarespatii.cpp:14:8: error: stray '\342' in program if (ch[i]==’ ‘ && ch[i-1]==’ ‘) {strcpy(ch+i,ch+i+1); i--;} ^ eliminarespatii.cpp:14:8: error: stray '\200' in program eliminarespatii.cpp:14:8: error: stray '\231' in program eliminarespatii.cpp:14:8: error: stray '\342' in program eliminarespatii.cpp:14:8: error: stray '\200' in program eliminarespatii.cpp:14:8: error: stray '\230' in program eliminarespatii.cpp:14:8: error: stray '\342' in program eliminarespatii.cpp:14:8: error: stray '\200' in program eliminarespatii.cpp:14:8: error: stray '\231' in program eliminarespatii.cpp:14:8: error: stray '\342' in program eliminarespatii.cpp:14:8: error: stray '\200' in program eliminarespatii.cpp:14:8: error: stray '\230' in program eliminarespatii.cpp:16:5: error: stray '\342' in program while ( ch[n-1]==’ ‘) strcpy(ch+n-2,ch+n-1); ^ eliminarespatii.cpp:16:5: error: stray '\200' in program eliminarespatii.cpp:16:5: error: stray '\231' in program eliminarespatii.cpp:16:5: error: stray '\342' in program eliminarespatii.cpp:16:5: error: stray '\200' in program eliminarespatii.cpp:16:5: error: stray '\230' in program eliminarespatii.cpp: In function 'int main()': eliminarespatii.cpp:12:27: error: expected primary-expression before ')' token while ( ch[0]==’ ‘) {strcpy (ch,ch+1)} ^ eliminarespatii.cpp:12:46: error: expected ';' before '}' token while ( ch[0]==’ ‘) {strcpy (ch,ch+1)} ^ eliminarespatii.cpp:13:9: error: 'i' was not declared in this scope for(i=1;i<strlen(ch);i++) ^ eliminarespatii.cpp:14:32: error: expected ')' before '[' token if (ch[i]==’ ‘ && ch[i-1]==’ ‘) {strcpy(ch+i,ch+i+1); i--;} ^ eliminarespatii.cpp:15:5: error: 'n' was not declared in this scope n=strlen(ch); ^ eliminarespatii.cpp:16:29: error: expected primary-expression before ')' token while ( ch[n-1]==’ ‘) strcpy(ch+n-2,ch+n-1); ^ eliminarespatii.cpp:14:30: error: label 'ch' used but not defined if (ch[i]==’ ‘ && ch[i-1]==’ ‘) {strcpy(ch+i,ch+i+1); i--;} ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema EliminareSpatii 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ă.