#4722
veselCifra
Dat un număr natural n
să se verifice dacă prima cifra este egal cu suma celorlalte cifre.
Concurs selectie clasa a 9-a Centru de Excelenta in Informatica - 2024 - Vaslui
Problema | veselCifra | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54055394 | Utilizator | |
Fișier | veselcifra.cpp | Dimensiune | 230 B |
Data încărcării | 18 Noiembrie 2024, 20:12 | Scor / rezultat | Eroare de compilare |
veselcifra.cpp:13:20: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] if(n==s) cout<<''DA''; ^ veselcifra.cpp:13:20: error: empty character constant veselcifra.cpp:13:24: error: empty character constant if(n==s) cout<<''DA''; ^ veselcifra.cpp:14:16: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] else cout<<''NU''; ^ veselcifra.cpp:14:16: error: empty character constant veselcifra.cpp:14:20: error: empty character constant else cout<<''NU''; ^ veselcifra.cpp:2:7: error: expected nested-name-specifier before 'namesapce' using namesapce std; ^ veselcifra.cpp:2:7: error: 'namesapce' has not been declared veselcifra.cpp:2:17: error: expected ';' before 'std' using namesapce std; ^ veselcifra.cpp:2:17: error: 'std' does not name a type veselcifra.cpp: In function 'int main()': veselcifra.cpp:8:5: error: 'cin' was not declared in this scope cin>>n; ^ veselcifra.cpp:8:5: note: suggested alternative: In file included from veselcifra.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ veselcifra.cpp:13:14: error: 'cout' was not declared in this scope if(n==s) cout<<''DA''; ^ veselcifra.cpp:13:14: note: suggested alternative: In file included from veselcifra.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ veselcifra.cpp:13:22: error: expected ';' before 'DA' if(n==s) cout<<''DA''; ^ veselcifra.cpp:14:10: error: 'cout' was not declared in this scope else cout<<''NU''; ^ veselcifra.cpp:14:10: note: suggested alternative: In file included from veselcifra.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ veselcifra.cpp:14:18: error: expected ';' before 'NU' else cout<<''NU''; ^ veselcifra.cpp:16:1: error: expected ';' before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema veselCifra 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ă.