#1360
Suma Gauss
Se citește n
număr natural. Calculați suma numerelor naturale mai mici sau egale cu n
.
Problema | Suma Gauss | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50080337 | Utilizator | |
Fișier | suma_gauss.cpp | Dimensiune | 154 B |
Data încărcării | 26 Martie 2024, 13:29 | Scor / rezultat | Eroare de compilare |
suma_gauss.cpp: In function 'int main()': suma_gauss.cpp:6:5: error: 'cin' was not declared in this scope cin>>b; ^ suma_gauss.cpp:6:5: note: suggested alternative: In file included from suma_gauss.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ suma_gauss.cpp:7:19: warning: left operand of comma operator has no effect [-Wunused-value] for (int i=1;i<=0,i++) ^ suma_gauss.cpp:7:26: error: expected ';' before ')' token for (int i=1;i<=0,i++) ^ suma_gauss.cpp:10:5: error: expected ';' before '}' token } ^ suma_gauss.cpp:11:5: error: 'cout' was not declared in this scope cout<<S<<end1<<end1<<end1; ^ suma_gauss.cpp:11:5: note: suggested alternative: In file included from suma_gauss.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ suma_gauss.cpp:11:14: error: 'end1' was not declared in this scope cout<<S<<end1<<end1<<end1; ^ suma_gauss.cpp:11:30: error: expected '}' at end of input cout<<S<<end1<<end1<<end1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Suma Gauss 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ă.