#101
SortareCuvinte
Să se scrie un program care citește o propoziţie şi afişează cuvintele din propoziţie ordonate alfabetic.
Problema | SortareCuvinte | Operații I/O |
sortcuv.in /sortcuv.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54418794 | Utilizator | |
Fișier | sortarecuvinte.cpp | Dimensiune | 465 B |
Data încărcării | 28 Noiembrie 2024, 06:19 | Scor / rezultat | Eroare de compilare |
sortarecuvinte.cpp:3:7: error: expected nested-name-specifier before 'namespacd' using namespacd std; ^ sortarecuvinte.cpp:3:7: error: 'namespacd' has not been declared sortarecuvinte.cpp:3:17: error: expected ';' before 'std' using namespacd std; ^ sortarecuvinte.cpp:3:17: error: 'std' does not name a type sortarecuvinte.cpp:4:1: error: 'ifstream' does not name a type ifstream fin ("sortcuv.in") ^ sortarecuvinte.cpp: In function 'int main()': sortarecuvinte.cpp:9:5: error: 'fin' was not declared in this scope { fin.get(s,251); ^ sortarecuvinte.cpp:9:13: error: 's' was not declared in this scope { fin.get(s,251); ^ sortarecuvinte.cpp:10:5: error: 'p' was not declared in this scope p=strtok (s, " "); ^ sortarecuvinte.cpp:12:14: error: 'cuv' was not declared in this scope { strcpy(cuv[n],p); ^ sortarecuvinte.cpp:12:18: error: 'n' was not declared in this scope { strcpy(cuv[n],p); ^ sortarecuvinte.cpp:16:21: error: 'n' was not declared in this scope for(int i=0; i<n; i++) ^ sortarecuvinte.cpp:17:19: error: 'cuv' was not declared in this scope { if(strcmp(cuv[i],cuv[i+1])>0) ^ sortarecuvinte.cpp:18:30: error: 'swap' was not declared in this scope swap(cuv[i],cuv[i+1]); ^ sortarecuvinte.cpp:18:30: note: suggested alternatives: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from sortarecuvinte.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2717:5: note: 'std::swap' swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, ^ In file included from /usr/include/c++/4.8/exception:152:0, from /usr/include/c++/4.8/ios:39, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from sortarecuvinte.cpp:1: /usr/include/c++/4.8/bits/exception_ptr.h:160:5: note: 'std::__exception_ptr::swap' swap(exception_ptr& __lhs, exception_ptr& __rhs) ^ sortarecuvinte.cpp:20:6: error: 'i' was not declared in this scope for(i=0,i<=n; i++) ^ sortarecuvinte.cpp:20:13: error: 'n' was not declared in this scope for(i=0,i<=n; i++) ^ sortarecuvinte.cpp:20:19: error: expected ';' before ')' token for(i=0,i<=n; i++) ^ sortarecuvinte.cpp:21:6: error: 'fout' was not declared in this scope fout<<cuv[i] ^ sortarecuvinte.cpp:21:12: error: 'cuv' was not declared in this scope fout<<cuv[i] ^ sortarecuvinte.cpp:22:3: error: expected ';' before 'return' return 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortareCuvinte 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ă.