#3978
sabc
Dacă x
și y
sunt două numere naturale cu x ≤ y
, atunci notăm cu s(x,y)
suma numerelor naturale cuprinse între x
și y
. De exemplu, s(3,6) = 3+4+5+6 = 18
, iar s(7,7) = 7
. Se dau numerele naturale a
, b
și c
, unde a ≤ b ≤ c
. Calculați s(a,b)
, s(b,c)
și s(a,c)
.
Problema | sabc | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54243685 | Utilizator | |
Fișier | sabc.cpp | Dimensiune | 517 B |
Data încărcării | 23 Noiembrie 2024, 11:25 | Scor / rezultat | Eroare de compilare |
sabc.cpp: In function 'int main()': sabc.cpp:3:1: error: 'cin' was not declared in this scope cin>>a>>b>>c; ^ sabc.cpp:8:1: error: 'cout' was not declared in this scope cout<<s<<" "; ^ In file included from /usr/include/c++/4.8/iostream:38:0, from sabc.cpp:19: /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:184:1: error: 'namespace' definition is not allowed here namespace std ^ /usr/include/c++/4.8/bits/memoryfwd.h:50:15: error: expected '=' before '__attribute__' namespace std _GLIBCXX_VISIBILITY(default) ^ /usr/include/c++/4.8/bits/memoryfwd.h:50:15: error: expected identifier before '__attribute__' /usr/include/c++/4.8/bits/memoryfwd.h:50:15: error: expected ';' before '__attribute__' /usr/include/c++/4.8/bits/memoryfwd.h:50:15: error: expected primary-expression before '__attribute__' /usr/include/c++/4.8/bits/memoryfwd.h:50:15: error: expected ';' before '__attribute__' /usr/include/c++/4.8/bits/stringfwd.h:42:15: error: expected '=' before '__attribute__' namespace std _GLIBCXX_VISIBILITY(default) ^ /usr/include/c++/4.8/bits/stringfwd.h:42:15: error: expected identifier before '__attribute__' /usr/include/c++/4.8/bits/stringfwd.h:42:15: error: expected ';' before '__attribute__' /usr/include/c++/4.8/bits/stringfwd.h:42:15: error: expected primary-expression before '__attribute__' /usr/include/c++/4.8/bits/stringfwd.h:42:15: error: expected ';' before '__attribute__' In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from sabc.cpp:19: /usr/include/wchar.h:132:1: error: expected unqualified-id before string constant __BEGIN_DECLS ^ In file included from /usr/include/c++/4.8/ios:39:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from sabc.cpp:19: /usr/include/c++/4.8/exception:35:37: error: expected '}' before end of line #pragma GCC visibility push(default) ^ /usr/include/c++/4.8/exception: At global scope: /usr/include/c++/4.8/exception:35:37: error: expected declaration before end of line
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sabc 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ă.