#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 | #64867252 | Utilizator | |
| Fișier | starsandbars1.cpp | Dimensiune | 1.07 KB |
| Data încărcării | 08 Iunie 2026, 14:07 | Scor/rezultat | Eroare de compilare |
starsandbars1.cpp: In function ‘int main()’: starsandbars1.cpp:22:20: error: cannot convert ‘int*’ to ‘const char*’ 22 | int n = strlen(nr1), m = strlen(nr2) | ^~~ | | | int* In file included from starsandbars1.cpp:2: /usr/include/string.h:407:35: note: initializing argument 1 of ‘size_t strlen(const char*)’ 407 | extern size_t strlen (const char *__s) | ~~~~~~~~~~~~^~~ starsandbars1.cpp:23:16: error: ‘m’ was not declared in this scope 23 | i = n; j = m; k = 0; | ^ starsandbars1.cpp:23:19: error: ‘k’ was not declared in this scope 23 | i = n; j = m; k = 0; | ^ starsandbars1.cpp:26:9: error: ‘sum’ was not declared in this scope 26 | sum[k] = (nr1[i] + nr2[j] + t) % 10 /*t ce avem in minte */ ; | ^~~ starsandbars1.cpp:26:37: error: ‘t’ was not declared in this scope 26 | sum[k] = (nr1[i] + nr2[j] + t) % 10 /*t ce avem in minte */ ; | ^ starsandbars1.cpp:27:21: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 27 | t=(nr1[i] + nr[j] + t) / 10; | ^~ | n starsandbars1.cpp:33:13: error: ‘sum’ was not declared in this scope 33 | sum[k++] = (nr2[i] + t)% 10; | ^~~ starsandbars1.cpp:33:34: error: ‘t’ was not declared in this scope 33 | sum[k++] = (nr2[i] + t)% 10; | ^ starsandbars1.cpp:36:8: error: ‘t’ was not declared in this scope 36 | if(t!=0) | ^ starsandbars1.cpp:38:9: error: ‘sum’ was not declared in this scope 38 | sum[k] = t; | ^~~ starsandbars1.cpp:46:9: error: ‘sum’ was not declared in this scope 46 | sum[k++] = (nr1[j] + t) % 10; | ^~~ starsandbars1.cpp:46:30: error: ‘t’ was not declared in this scope 46 | sum[k++] = (nr1[j] + t) % 10; | ^ starsandbars1.cpp:49:8: error: ‘t’ was not declared in this scope 49 | if(t != 0) | ^ starsandbars1.cpp:51:9: error: ‘sum’ was not declared in this scope 51 | sum[k] = t; | ^~~ starsandbars1.cpp:56:17: error: ‘sum’ was not declared in this scope 56 | 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ă.