#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 | #55044153 | Utilizator | |
Fișier | sabc.cpp | Dimensiune | 290 B |
Data încărcării | 18 Decembrie 2024, 10:22 | Scor / rezultat | Eroare de compilare |
sabc.cpp:7:6: error: stray '\342' in program a ≤ b ≤ c; ^ sabc.cpp:7:6: error: stray '\211' in program sabc.cpp:7:6: error: stray '\244' in program sabc.cpp:7:6: error: stray '\342' in program sabc.cpp:7:6: error: stray '\211' in program sabc.cpp:7:6: error: stray '\244' in program sabc.cpp: In function 'int main()': sabc.cpp:5:16: error: expression list treated as compound expression in initializer [-fpermissive] int a,b,c,s(a,b),s(b,c),s(a,c); ^ sabc.cpp:5:16: warning: left operand of comma operator has no effect [-Wunused-value] sabc.cpp:5:20: error: redeclaration of 'int s' int a,b,c,s(a,b),s(b,c),s(a,c); ^ sabc.cpp:5:11: error: 'int s' previously declared here int a,b,c,s(a,b),s(b,c),s(a,c); ^ sabc.cpp:5:27: error: redeclaration of 'int s' int a,b,c,s(a,b),s(b,c),s(a,c); ^ sabc.cpp:5:11: error: 'int s' previously declared here int a,b,c,s(a,b),s(b,c),s(a,c); ^ sabc.cpp:6:20: error: 's' cannot be used as a function cin>>a>>b>>c>>s(a,b)<<s(b,c)<<s(a,c); ^ sabc.cpp:6:28: error: 's' cannot be used as a function cin>>a>>b>>c>>s(a,b)<<s(b,c)<<s(a,c); ^ sabc.cpp:6:36: error: 's' cannot be used as a function cin>>a>>b>>c>>s(a,b)<<s(b,c)<<s(a,c); ^ sabc.cpp:7:12: error: expected ';' before 'b' a ≤ b ≤ c; ^ sabc.cpp:7:19: warning: statement has no effect [-Wunused-value] a ≤ b ≤ c; ^ sabc.cpp:8:11: error: 's' cannot be used as a function s(a,b) = a+...+b; ^ sabc.cpp:8:17: error: expected primary-expression before '...' token s(a,b) = a+...+b; ^ sabc.cpp:8:17: error: expected ';' before '...' token sabc.cpp:9:11: error: 's' cannot be used as a function s(b,c) = b+...+c; ^ sabc.cpp:9:17: error: expected primary-expression before '...' token s(b,c) = b+...+c; ^ sabc.cpp:9:17: error: expected ';' before '...' token sabc.cpp:10:11: error: 's' cannot be used as a function s(a,c) = a+...+c; ^ sabc.cpp:10:17: error: expected primary-expression before '...' token s(a,c) = a+...+c; ^ sabc.cpp:10:17: error: expected ';' before '...' token sabc.cpp:12:17: error: 's' cannot be used as a function cout <<s(a,b)<<s(b,c)<<s(a,c)<< endl; ^ sabc.cpp:12:25: error: 's' cannot be used as a function cout <<s(a,b)<<s(b,c)<<s(a,c)<< endl; ^ sabc.cpp:12:33: error: 's' cannot be used as a function cout <<s(a,b)<<s(b,c)<<s(a,c)<< endl; ^
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ă.