#1141
ech
Numim număr echilibrat un număr natural pentru care suma cifrelor de pe poziţii pare este egală cu suma cifrelor de pe poziţii impare.
De exemplu numărul 13552
este echilibrat, pentru că 1+5+2=8=3+5
.
Dat fiind un număr natural N
să se determine cel mai mic număr echilibrat, strict mai mare decât N
.
OJI 2015, Clasa a VII-a
Problema | ech | Operații I/O |
ech.in /ech.out
|
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #51707360 | Utilizator | |
Fișier | ech.cpp | Dimensiune | 1.61 KB |
Data încărcării | 06 August 2024, 17:06 | Scor / rezultat | Eroare de compilare |
ech.cpp:47:2: error: stray '#' in program }#include <bits/stdc++.h> ^ ech.cpp:47:3: error: 'include' does not name a type }#include <bits/stdc++.h> ^ ech.cpp:49:12: error: redefinition of 'std::ifstream in' ifstream in("ech.in"); ^ ech.cpp:3:10: error: 'std::ifstream in' previously declared here ifstream in("ech.in"); ^ ech.cpp:50:13: error: redefinition of 'std::ofstream out' ofstream out("ech.out"); ^ ech.cpp:4:10: error: 'std::ofstream out' previously declared here ofstream out("ech.out"); ^ ech.cpp:51:9: error: redefinition of 'int v [30]' int v[30]; ^ ech.cpp:5:5: error: 'int v [30]' previously declared here int v[30]; ^ ech.cpp: In function 'bool ok()': ech.cpp:52:6: error: redefinition of 'bool ok()' bool ok(){ ^ ech.cpp:6:6: error: 'bool ok()' previously defined here bool ok(){ ^ ech.cpp: In function 'void add()': ech.cpp:64:6: error: redefinition of 'void add()' void add(){ ^ ech.cpp:18:6: error: 'void add()' previously defined here void add(){ ^ ech.cpp: In function 'void afis()': ech.cpp:76:6: error: redefinition of 'void afis()' void afis(){ ^ ech.cpp:30:6: error: 'void afis()' previously defined here void afis(){ ^ ech.cpp: In function 'int main()': ech.cpp:80:5: error: redefinition of 'int main()' int main() ^ ech.cpp:34:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ech 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ă.