#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 | #50907073 | Utilizator | |
Fișier | sortcif.cpp | Dimensiune | 675 B |
Data încărcării | 13 Mai 2024, 18:58 | Scor / rezultat | Eroare de compilare |
sortcif.cpp: In function 'int main()': sortcif.cpp:5:5: error: 'ifstream' was not declared in this scope ifstream fin("sortcif.in"); ^ sortcif.cpp:5:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from sortcif.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ sortcif.cpp:5:14: error: expected ';' before 'fin' ifstream fin("sortcif.in"); ^ sortcif.cpp:6:5: error: 'ofstream' was not declared in this scope ofstream fout("sorcif.out"); ^ sortcif.cpp:6:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from sortcif.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ sortcif.cpp:6:14: error: expected ';' before 'fout' ofstream fout("sorcif.out"); ^ sortcif.cpp:8:5: error: 'fin' was not declared in this scope fin>>n; ^ sortcif.cpp:23:13: error: 'j' was not declared in this scope for(j=i+1;j<=n;j++) ^ sortcif.cpp:27:31: error: 'swap' was not declared in this scope swap(v[i],v[j]); ^ sortcif.cpp:27:31: 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sortcif.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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sortcif.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) ^ sortcif.cpp:33:9: error: 'fout' was not declared in this scope fout<<v[i]<<' '; ^
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ă.