#130
SortCif
Să se scrie un program care ordonează elementele unui vector crescător după suma cifrelor.
Problema | SortCif | Operații I/O |
sortcif.in /sortcif.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50050373 | Utilizator | |
Fișier | sortcif.cpp | Dimensiune | 1.12 KB |
Data încărcării | 25 Martie 2024, 14:54 | Scor / rezultat | Eroare de compilare |
sortcif.cpp:4:29: error: no matching function for call to 'std::basic_istream<char>::basic_istream(const char [10])' istream fin ("sorcif.in") ^ sortcif.cpp:4:29: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from sortcif.cpp:1: /usr/include/c++/4.8/istream:606:7: note: std::basic_istream<_CharT, _Traits>::basic_istream() [with _CharT = char; _Traits = std::char_traits<char>] basic_istream() ^ /usr/include/c++/4.8/istream:606:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/4.8/istream:93:7: note: std::basic_istream<_CharT, _Traits>::basic_istream(std::basic_istream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] basic_istream(__streambuf_type* __sb) ^ /usr/include/c++/4.8/istream:93:7: note: no known conversion for argument 1 from 'const char [10]' to 'std::basic_istream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}' sortcif.cpp:5:5: error: expected ',' or ';' before 'ofstream' ofstream fout("sortcif.out") ^ sortcif.cpp: In function 'int main()': sortcif.cpp:10:14: error: 'n' was not declared in this scope fin>>n; ^ sortcif.cpp:11:13: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ sortcif.cpp:13:11: error: 'x' was not declared in this scope x=abs(v[i]); ^ sortcif.cpp:14:11: error: 's' was not declared in this scope s=0; ^ sortcif.cpp:17:15: error: 'u' was not declared in this scope u=x%10; ^ sortcif.cpp: In lambda function: sortcif.cpp:21:17: error: expected '{' before '=' token sc=[i]=s; ^ sortcif.cpp: In function 'int main()': sortcif.cpp:23:18: error: 'j' was not declared in this scope for (j=i+1; j<=n; j++) ^ sortcif.cpp:24:33: error: 'aux' was not declared in this scope if(sc[i]>sc[j]) { aux=v[i]; ^ sortcif.cpp:33:33: error: expected primary-expression before 'else' else { ^ sortcif.cpp:33:33: error: expected ';' before 'else' sortcif.cpp:38:11: error: 'fout' was not declared in this scope fout<< v[i] << " "; ^ sortcif.cpp:39:5: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortCif 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ă.