#1566
CifSort
Se citeste n
. Afisati numarul, cu prima cifra inversata cu a 2
-a, a 3
-a cu a 4
-a, etc.
Problema | CifSort | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #25164117 | Utilizator | |
Fișier | cifsort.cpp | Dimensiune | 251 B |
Data încărcării | 29 Octombrie 2020, 14:30 | Scor / rezultat | Eroare de compilare |
cifsort.cpp:2:13: error: expected '{' before ';' token namespace st; ^ cifsort.cpp: In function 'int st::main()': cifsort.cpp:8:4: error: 'cin' was not declared in this scope cin>>n; ^ cifsort.cpp:8:4: note: suggested alternative: In file included from cifsort.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ cifsort.cpp:11:1: error: expected primary-expression before '}' token } ^ cifsort.cpp:11:1: error: expected ';' before '}' token cifsort.cpp:6:13: warning: unused variable 'n2' [-Wunused-variable] long int n, n2=0, d=1, cif=0; ^ cifsort.cpp:6:19: warning: unused variable 'd' [-Wunused-variable] long int n, n2=0, d=1, cif=0; ^ cifsort.cpp:6:24: warning: unused variable 'cif' [-Wunused-variable] long int n, n2=0, d=1, cif=0; ^ cifsort.cpp:11:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ cifsort.cpp: At global scope: cifsort.cpp:12:5: error: 'cif' does not name a type cif = 10 * (n%10) + (n/10%10); ^ cifsort.cpp:13:5: error: 'n2' does not name a type n2 = n2 + cif * d; ^ cifsort.cpp:14:5: error: 'd' does not name a type d = d * 100; ^ cifsort.cpp:15:5: error: 'n' does not name a type n = n / 100; ^ cifsort.cpp:20:4: error: 'cout' does not name a type cout<<n2; ^ cifsort.cpp:21:1: error: expected unqualified-id before 'return' return 0; ^ cifsort.cpp:22:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifSort 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ă.