#2021
SumaGauss2
Ana a calculat suma numerelor naturale mai mici sau egale cu n
, iar Andreea suma numerelor naturale mai mici sau egale cu m
. Doamna de mate a calculat apoi diferenţa celor două sume şi a obţinut rezultatul S
.
Pentru o valoare S
dată, aflaţi toate perechile (n,m)
, cu n>m
, scriindu-le în ordine descrescătoare după n
astfel încât doamna de mate să obţină rezultatul S
.
Problema | SumaGauss2 | Operații I/O |
sumagauss2.in /sumagauss2.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54212472 | Utilizator | |
Fișier | sumagauss2.cpp | Dimensiune | 465 B |
Data încărcării | 22 Noiembrie 2024, 10:55 | Scor / rezultat | Eroare de compilare |
sumagauss2.cpp: In function 'int main()': sumagauss2.cpp:5:4: error: 'ifstream' was not declared in this scope ifstream f ("sumagauss2.in"); ^ sumagauss2.cpp:5:4: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from sumagauss2.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ sumagauss2.cpp:5:13: error: expected ';' before 'f' ifstream f ("sumagauss2.in"); ^ sumagauss2.cpp:6:4: error: 'ofstream' was not declared in this scope ofstream g ("sumagauss2.out"); ^ sumagauss2.cpp:6:4: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from sumagauss2.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ sumagauss2.cpp:6:13: error: expected ';' before 'g' ofstream g ("sumagauss2.out"); ^ sumagauss2.cpp:9:4: error: 'f' was not declared in this scope f >> S; ^ sumagauss2.cpp:14:11: error: 'S12' was not declared in this scope if (S12 % d == 0) ^ sumagauss2.cpp:24:10: error: 'g' was not declared in this scope g << n << ' ' << m << endl; ^ sumagauss2.cpp:24:32: error: 'endl' was not declared in this scope g << n << ' ' << m << endl; ^ sumagauss2.cpp:24:32: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from sumagauss2.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumaGauss2 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ă.