#3978
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 | #53909280 | Utilizator | |
| Fișier | sabc.cpp | Dimensiune | 433 B |
| Data încărcării | 14 Noiembrie 2024, 14:46 | Scor/rezultat | Eroare de compilare |
sabc.cpp: In function 'int main()': sabc.cpp:9:9: error: expected ',' before '*' token d=[b*(b+1)]/2; ^ sabc.cpp:9:9: error: expected identifier before '*' token sabc.cpp: In lambda function: sabc.cpp:9:16: error: expected '{' before '/' token d=[b*(b+1)]/2; ^ sabc.cpp: In function 'int main()': sabc.cpp:9:16: error: no match for 'operator/' (operand types are 'main()::__lambda0' and 'int') sabc.cpp:10:14: error: expected identifier before '(' token e=(a-1)*[(a-1)+1]/2; ^ sabc.cpp: In lambda function: sabc.cpp:10:22: error: expected '{' before '/' token e=(a-1)*[(a-1)+1]/2; ^ sabc.cpp: In function 'int main()': sabc.cpp:10:12: error: no match for 'operator*' (operand types are 'int' and 'main()::__lambda1') e=(a-1)*[(a-1)+1]/2; ^ sabc.cpp:14:14: error: expected identifier before '(' token g=(b-1)*[(b-1)+1]/2; ^ sabc.cpp: In lambda function: sabc.cpp:14:22: error: expected '{' before '/' token g=(b-1)*[(b-1)+1]/2; ^ sabc.cpp: In function 'int main()': sabc.cpp:14:12: error: no match for 'operator*' (operand types are 'int' and 'main()::__lambda2') g=(b-1)*[(b-1)+1]/2; ^ sabc.cpp:18:14: error: expected identifier before '(' token i=(a-1)*[(a-1)+1]/2; ^ sabc.cpp: In lambda function: sabc.cpp:18:22: error: expected '{' before '/' token i=(a-1)*[(a-1)+1]/2; ^ sabc.cpp: In function 'int main()': sabc.cpp:18:12: error: no match for 'operator*' (operand types are 'int' and 'main()::__lambda3') i=(a-1)*[(a-1)+1]/2; ^
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ă.