#893
Cuvinte0
Se dă un șir de caractere format din cuvinte, separate prin spații. Cuvintele conțin doar litere mici ale alfabetului englez. Afișați, în ordine lexicografică, cuvintele distincte din șir.
Problema | Cuvinte0 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54083543 | Utilizator | |
Fișier | cuvinte0.cpp | Dimensiune | 1.07 KB |
Data încărcării | 19 Noiembrie 2024, 13:14 | Scor / rezultat | Eroare de compilare |
cuvinte0.cpp: In function 'int main()': cuvinte0.cpp:8:21: error: no matching function for call to 'std::basic_istream<char>::getline(char [260][260], int)' cin.getline(s,260); ^ cuvinte0.cpp:8:21: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from cuvinte0.cpp:1: /usr/include/c++/4.8/istream:618:5: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize, std::basic_istream<_CharT, _Traits>::char_type) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int] basic_istream<char>:: ^ /usr/include/c++/4.8/istream:618:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/4.8/istream:427:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int] getline(char_type* __s, streamsize __n) ^ /usr/include/c++/4.8/istream:427:7: note: no known conversion for argument 1 from 'char [260][260]' to 'std::basic_istream<char>::char_type* {aka char*}' cuvinte0.cpp:9:4: error: 'n' was not declared in this scope n=strlen(s); ^ cuvinte0.cpp:9:14: error: cannot convert 'char (*)[260]' to 'const char*' for argument '1' to 'size_t strlen(const char*)' n=strlen(s); ^ cuvinte0.cpp:10:4: error: 'c' was not declared in this scope c=0; ^ cuvinte0.cpp:13:5: error: 'k' was not declared in this scope k=0; ^ cuvinte0.cpp:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(s[i]!=' ') ^ cuvinte0.cpp:17:9: error: 'cuv' was not declared in this scope cuv[k++]=s[i]; ^ cuvinte0.cpp:20:9: error: 'cuv' was not declared in this scope cuv[k]=NULL; ^ cuvinte0.cpp:23:12: error: 'ok' was not declared in this scope ok=0; ^ cuvinte0.cpp:24:16: error: 'j' was not declared in this scope for(j=1;j<=c;j++) ^ cuvinte0.cpp:26:26: error: 'v' was not declared in this scope if(strcmp(v[j],cuv)==0) ^ cuvinte0.cpp:33:23: error: expected ';' before ':' token c++: ^ cuvinte0.cpp:35:19: error: 'v' was not declared in this scope strcpy(v[c],cuv); /// adaug cuv pe linia c in matricea v ^ cuvinte0.cpp:42:12: error: 'j' was not declared in this scope for(j=i+1;j<=c;j++) ^ cuvinte0.cpp:44:22: error: 'v' was not declared in this scope if(strcmp(v[i],v[j])>0) ^ cuvinte0.cpp:54:14: error: 'v' was not declared in this scope cout<<v[i]<<endl; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuvinte0 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ă.