#119
2maxim
Să se scrie un program care citește un șir de n
numere naturale şi determină cele mai mari două numere din şir.
Problema | 2maxim | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54968391 | Utilizator | |
Fișier | maxim.cpp | Dimensiune | 357 B |
Data încărcării | 14 Decembrie 2024, 09:13 | Scor / rezultat | Eroare de compilare |
maxim.cpp:2:7: error: expected nested-name-specifier before 'namespce' using namespce std; ^ maxim.cpp:2:7: error: 'namespce' has not been declared maxim.cpp:2:16: error: expected ';' before 'std' using namespce std; ^ maxim.cpp:2:16: error: 'std' does not name a type maxim.cpp: In function 'int main()': maxim.cpp:4:12: error: expected initializer before '.' token int n,a. maxn1=0, max2=0; ^ maxim.cpp:5:5: error: 'cin' was not declared in this scope cin>>n; ^ maxim.cpp:5:5: note: suggested alternative: In file included from maxim.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ maxim.cpp:8:14: error: 'a' was not declared in this scope cin>>a; ^ maxim.cpp:9:14: error: 'max1' was not declared in this scope if(a>max1) ^ maxim.cpp:11:13: error: 'max2' was not declared in this scope max2=max1; ^ maxim.cpp:14:18: error: 'max2' was not declared in this scope elseif(a>max2) ^ maxim.cpp:14:22: error: 'elseif' was not declared in this scope elseif(a>max2) ^ maxim.cpp:15:9: error: expected ';' before '{' token { ^ maxim.cpp:19:5: error: 'cout' was not declared in this scope cout<<max1<<" "<<max2; ^ maxim.cpp:19:5: note: suggested alternative: In file included from maxim.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ maxim.cpp:19:11: error: 'max1' was not declared in this scope cout<<max1<<" "<<max2; ^ maxim.cpp:19:22: error: 'max2' was not declared in this scope cout<<max1<<" "<<max2; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema 2maxim 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ă.