#493
Se dă un vector x cu n elemente, numere naturale. Să se construiască un alt vector, y, cu proprietatea că y[i] este egal cu restul împărțirii lui x[i] la suma cifrelor lui x[i].
| Problema | Constr | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64726189 | Utilizator | |
| Fișier | constr.cpp | Dimensiune | 266 B |
| Data încărcării | 26 Mai 2026, 11:24 | Scor/rezultat | Eroare de compilare |
constr.cpp:1:21: warning: extra tokens at end of #include directive 1 | #include <iostream> using namespace std; | ^~~~~ constr.cpp:13:34: error: extended character « is not valid in an identifier 13 | if (s == 0) cout << 0; else cout «< x % s; | ^ constr.cpp:14:9: error: extended character “ is not valid in an identifier 14 | cout << “ “; | ^ constr.cpp:14:11: error: extended character “ is not valid in an identifier 14 | cout << “ “; | ^ constr.cpp: In function ‘int main()’: constr.cpp:4:11: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 4 | int n, x; cin >> n; | ^~~ | std::cin In file included from constr.cpp:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ constr.cpp:11:1: error: ‘S’ was not declared in this scope 11 | S += aux % 10; aux /= 10; | ^ constr.cpp:13:13: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 13 | if (s == 0) cout << 0; else cout «< x % s; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ constr.cpp:13:29: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 13 | if (s == 0) cout << 0; else cout «< x % s; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ constr.cpp:14:1: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 14 | cout << “ “; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ constr.cpp:14:9: error: ‘“’ was not declared in this scope 14 | cout << “ “; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Constr 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ă.