#945
Se dă un număr n scris în baza b și trebuie afișat în baza c.
| Problema | baze | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64320011 | Utilizator | |
| Fișier | baze.cpp | Dimensiune | 351 B |
| Data încărcării | 29 Aprilie 2026, 13:58 | Scor/rezultat | Eroare de compilare |
baze.cpp: In function ‘int main()’: baze.cpp:5:9: error: expected identifier before numeric constant 5 | int[100] n, b, c, m, x=1, a=0; | ^~~ baze.cpp:5:9: error: expected ‘]’ before numeric constant 5 | int[100] n, b, c, m, x=1, a=0; | ^~~ | ] baze.cpp:5:8: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 5 | int[100] n, b, c, m, x=1, a=0; | ^ baze.cpp:5:8: error: structured binding declaration cannot have type ‘int’ baze.cpp:5:8: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’ baze.cpp:5:8: error: empty structured binding declaration baze.cpp:5:14: error: expected initializer before ‘n’ 5 | int[100] n, b, c, m, x=1, a=0; | ^ baze.cpp:6:9: error: expected identifier before numeric constant 6 | int[100] x2, r=0, p=1; | ^~~ baze.cpp:6:9: error: expected ‘]’ before numeric constant 6 | int[100] x2, r=0, p=1; | ^~~ | ] baze.cpp:6:8: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 6 | int[100] x2, r=0, p=1; | ^ baze.cpp:6:8: error: structured binding declaration cannot have type ‘int’ baze.cpp:6:8: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’ baze.cpp:6:8: error: empty structured binding declaration baze.cpp:6:14: error: expected initializer before ‘x2’ 6 | int[100] x2, r=0, p=1; | ^~ baze.cpp:7:10: error: ‘n’ was not declared in this scope 7 | cin>>n >>b>>c; | ^ baze.cpp:7:14: error: ‘b’ was not declared in this scope 7 | cin>>n >>b>>c; | ^ baze.cpp:7:17: error: ‘c’ was not declared in this scope 7 | cin>>n >>b>>c; | ^ baze.cpp:11:9: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 11 | m=n%10; | ^ | tm baze.cpp:12:9: error: ‘a’ was not declared in this scope 12 | a+=x*m; | ^ baze.cpp:12:12: error: ‘x’ was not declared in this scope 12 | a+=x*m; | ^ baze.cpp:16:11: error: ‘a’ was not declared in this scope 16 | while(a) | ^ baze.cpp:18:9: error: ‘x2’ was not declared in this scope 18 | x2=a%c; | ^~ baze.cpp:19:9: error: ‘r’ was not declared in this scope 19 | r+=x2*p; | ^ baze.cpp:19:15: error: ‘p’ was not declared in this scope 19 | r+=x2*p; | ^ baze.cpp:23:11: error: ‘r’ was not declared in this scope 23 | cout<<r; | ^ baze.cpp:5:8: warning: unused structured binding declaration [-Wunused-variable] 5 | int[100] n, b, c, m, x=1, a=0; | ^ baze.cpp:6:8: warning: unused structured binding declaration [-Wunused-variable] 6 | int[100] x2, r=0, p=1; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema baze 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ă.