#3741
Gigel are n bile și k cutii. În câte moduri poate plasa Gigel bilele în cutii, știind că pot rămâne și cutii goale.
| Problema | StarsAndBars1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64896813 | Utilizator | |
| Fișier | starsandbars1.cpp | Dimensiune | 1.55 KB |
| Data încărcării | 10 Iunie 2026, 13:29 | Scor/rezultat | Eroare de compilare |
starsandbars1.cpp: In function ‘int main()’: starsandbars1.cpp:37:19: error: ‘k’ was not declared in this scope 37 | i = n; j = m; k = 0; | ^ starsandbars1.cpp:39:15: error: expected ‘;’ before ‘)’ token 39 | for(i >= 0) | ^ | ; starsandbars1.cpp:39:11: warning: statement has no effect [-Wunused-value] 39 | for(i >= 0) | ~~^~~~ starsandbars1.cpp:46:9: error: expected primary-expression before ‘if’ 46 | if(j >= 0) | ^~ starsandbars1.cpp:45:10: error: expected ‘;’ before ‘if’ 45 | } | ^ | ; 46 | if(j >= 0) | ~~ starsandbars1.cpp:46:9: error: expected primary-expression before ‘if’ 46 | if(j >= 0) | ^~ starsandbars1.cpp:45:10: error: expected ‘)’ before ‘if’ 45 | } | ^ | ) 46 | if(j >= 0) | ~~ starsandbars1.cpp:39:8: note: to match this ‘(’ 39 | for(i >= 0) | ^ starsandbars1.cpp:49:17: error: ‘sum’ was not declared in this scope 49 | sum[k++] = (nr2[i] + t)% 10; | ^~~ starsandbars1.cpp:49:38: error: ‘t’ was not declared in this scope 49 | sum[k++] = (nr2[i] + t)% 10; | ^ starsandbars1.cpp:55:8: error: ‘t’ was not declared in this scope 55 | if(t!=0) | ^ starsandbars1.cpp:57:9: error: ‘sum’ was not declared in this scope 57 | sum[k] = t; | ^~~ starsandbars1.cpp:65:9: error: ‘sum’ was not declared in this scope 65 | sum[k++] = (nr1[j] + t) % 10; | ^~~ starsandbars1.cpp:65:30: error: ‘t’ was not declared in this scope 65 | sum[k++] = (nr1[j] + t) % 10; | ^ starsandbars1.cpp:68:8: error: ‘t’ was not declared in this scope 68 | if(t != 0) | ^ starsandbars1.cpp:70:9: error: ‘sum’ was not declared in this scope 70 | sum[k] = t; | ^~~ starsandbars1.cpp:75:17: error: ‘sum’ was not declared in this scope 75 | cout << sum[i]; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema StarsAndBars1 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ă.