#974
Resturi
Să se afle suma resturilor împărțirii tuturor numerelor naturale de la 1
la n
printr-un număr k
.
Problema | Resturi | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #10445040 | Utilizator | |
Fișier | resturi.cpp | Dimensiune | 239 B |
Data încărcării | 23 Septembrie 2018, 22:48 | Scor / rezultat | Eroare de compilare |
resturi.cpp:5:1: error: stray '\302' in program unsigned int n, k, suma = 0, i; ^ resturi.cpp:5:1: error: stray '\240' in program resturi.cpp:5:1: error: stray '\302' in program resturi.cpp:5:1: error: stray '\240' in program resturi.cpp:5:1: error: stray '\302' in program resturi.cpp:5:1: error: stray '\240' in program resturi.cpp:5:1: error: stray '\302' in program resturi.cpp:5:1: error: stray '\240' in program resturi.cpp:6:1: error: stray '\302' in program ^ resturi.cpp:6:1: error: stray '\240' in program resturi.cpp:6:1: error: stray '\302' in program resturi.cpp:6:1: error: stray '\240' in program resturi.cpp:6:1: error: stray '\302' in program resturi.cpp:6:1: error: stray '\240' in program resturi.cpp:7:1: error: stray '\302' in program cin >> n; ^ resturi.cpp:7:1: error: stray '\240' in program resturi.cpp:7:1: error: stray '\302' in program resturi.cpp:7:1: error: stray '\240' in program resturi.cpp:7:1: error: stray '\302' in program resturi.cpp:7:1: error: stray '\240' in program resturi.cpp:8:1: error: stray '\302' in program cin >> k; ^ resturi.cpp:8:1: error: stray '\240' in program resturi.cpp:8:1: error: stray '\302' in program resturi.cpp:8:1: error: stray '\240' in program resturi.cpp:8:1: error: stray '\302' in program resturi.cpp:8:1: error: stray '\240' in program resturi.cpp:10:1: error: stray '\302' in program for(i = 0; i <=n; i++) { ^ resturi.cpp:10:1: error: stray '\240' in program resturi.cpp:10:1: error: stray '\302' in program resturi.cpp:10:1: error: stray '\240' in program resturi.cpp:11:1: error: stray '\302' in program suma = suma + (i%k) ^ resturi.cpp:11:1: error: stray '\240' in program resturi.cpp:11:1: error: stray '\302' in program resturi.cpp:11:1: error: stray '\240' in program resturi.cpp:12:1: error: stray '\302' in program } ^ resturi.cpp:12:1: error: stray '\240' in program resturi.cpp:12:1: error: stray '\302' in program resturi.cpp:12:1: error: stray '\240' in program resturi.cpp:14:1: error: stray '\302' in program cout << suma; ^ resturi.cpp:14:1: error: stray '\240' in program resturi.cpp:14:1: error: stray '\302' in program resturi.cpp:14:1: error: stray '\240' in program resturi.cpp:16:1: error: stray '\302' in program return 0; ^ resturi.cpp:16:1: error: stray '\240' in program resturi.cpp:16:1: error: stray '\302' in program resturi.cpp:16:1: error: stray '\240' in program resturi.cpp: In function 'int main()': resturi.cpp:7:8: error: 'cin' was not declared in this scope cin >> n; ^ resturi.cpp:7:8: note: suggested alternative: In file included from resturi.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ resturi.cpp:12:7: error: expected ';' before '}' token } ^ resturi.cpp:14:7: error: 'cout' was not declared in this scope cout << suma; ^ resturi.cpp:14:7: note: suggested alternative: In file included from resturi.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Resturi 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ă.