#2245
Plata1
Se consideră n
tipuri de bancnote, cu valorile v[1] v[2] ... v[n]
, ordonate strict crescător. Pentru fiecare tip de bancnote se știe numărul de bancnote disponibile c[1] c[2] ... c[n]
. Se cere să se determine o modalitate de a plăti integral o sumă dată S
cu bancnotele disponibile.
Problema | Plata1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49725805 | Utilizator | |
Fișier | plata1.cpp | Dimensiune | 578 B |
Data încărcării | 13 Martie 2024, 11:56 | Scor / rezultat | Eroare de compilare |
plata1.cpp:1:10: error: #include expects "FILENAME" or <FILENAME> #include iostream ^ plata1.cpp:5:1: error: stray '\342' in program count<<nr[i] << “ “; ^ plata1.cpp:5:1: error: stray '\200' in program plata1.cpp:5:1: error: stray '\234' in program plata1.cpp:5:1: error: stray '\342' in program plata1.cpp:5:1: error: stray '\200' in program plata1.cpp:5:1: error: stray '\234' in program plata1.cpp:6:1: error: stray '\342' in program count << “\n”;} ^ plata1.cpp:6:1: error: stray '\200' in program plata1.cpp:6:1: error: stray '\234' in program plata1.cpp:6:1: error: stray '\' in program plata1.cpp:6:1: error: stray '\342' in program plata1.cpp:6:1: error: stray '\200' in program plata1.cpp:6:1: error: stray '\235' in program plata1.cpp: In function 'void afisare(int)': plata1.cpp:5:1: error: 'count' was not declared in this scope count<<nr[i] << “ “; ^ plata1.cpp:5:8: error: 'nr' was not declared in this scope count<<nr[i] << “ “; ^ plata1.cpp:5:24: error: expected primary-expression before ';' token count<<nr[i] << “ “; ^ plata1.cpp:6:1: error: 'count' was not declared in this scope count << “\n”;} ^ plata1.cpp:6:14: error: 'n' was not declared in this scope count << “\n”;} ^ plata1.cpp: In function 'void Back(int, int)': plata1.cpp:9:7: error: 'n' was not declared in this scope if(k<=n &&. sum<=S) ^ plata1.cpp:9:11: error: expected primary-expression before '.' token if(k<=n &&. sum<=S) ^ plata1.cpp:9:18: error: 'S' was not declared in this scope if(k<=n &&. sum<=S) ^ plata1.cpp:10:16: error: 'nr' was not declared in this scope for(int i=0; i<nr[k] && sum+i* v[i] <=S && sw==1;; i++){ ^ plata1.cpp:10:32: error: 'v' was not declared in this scope for(int i=0; i<nr[k] && sum+i* v[i] <=S && sw==1;; i++){ ^ plata1.cpp:10:44: error: 'sw' was not declared in this scope for(int i=0; i<nr[k] && sum+i* v[i] <=S && sw==1;; i++){ ^ plata1.cpp:10:50: error: expected primary-expression before ';' token for(int i=0; i<nr[k] && sum+i* v[i] <=S && sw==1;; i++){ ^ plata1.cpp:10:50: error: expected ')' before ';' token plata1.cpp:10:52: error: 'i' was not declared in this scope for(int i=0; i<nr[k] && sum+i* v[i] <=S && sw==1;; i++){ ^ plata1.cpp:10:55: error: expected ';' before ')' token for(int i=0; i<nr[k] && sum+i* v[i] <=S && sw==1;; i++){ ^ plata1.cpp: In function 'int main()': plata1.cpp:25:5: error: 'cin' was not declared in this scope cin>>n>>S; ^ plata1.cpp:24:5: warning: unused variable 'sum' [-Wunused-variable] int sum= 0; ^ plata1.cpp: At global scope: plata1.cpp:28:6: error: expected unqualified-id before 'for' for(int i=1; i<=n; i++) { ^ plata1.cpp:28:19: error: 'i' does not name a type for(int i=1; i<=n; i++) { ^ plata1.cpp:28:25: error: 'i' does not name a type for(int i=1; i<=n; i++) { ^ plata1.cpp:31:1: error: expected unqualified-id before 'return' return 0; ^ plata1.cpp:32:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Plata1 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ă.