#3170
Plata3
Se consideră n
tipuri de bancnote, cu valorile v[1] v[2] ... v[n]
, ordonate strict crescător. Se cere să se determine o modalitate de a plăti integral o sumă dată S
cu bancnotele disponibile, știind că se pot folosi oricâte bancnote de orice tip.
Problema | Plata3 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34831135 | Utilizator | |
Fișier | plata3.cpp | Dimensiune | 779 B |
Data încărcării | 15 Februarie 2022, 11:31 | Scor / rezultat | Eroare de compilare |
plata3.cpp:8:1: error: expected ',' or ';' before 'ofstream' ofstream out("partitiinumar.out") ^ plata3.cpp: In function 'int bun(int)': plata3.cpp:13:13: error: 'sol' was not declared in this scope if (sol[k]<sol[k-1]) ^ plata3.cpp:15:5: error: 's' was not declared in this scope s=0; ^ plata3.cpp:16:9: error: 'i' was not declared in this scope for(i=1; i<=k; i++) ^ plata3.cpp:17:13: error: 'sol' was not declared in this scope s=s+sol[k]; ^ plata3.cpp:18:10: error: 'n' was not declared in this scope if(s>n) ^ plata3.cpp: In function 'int solutie(int)': plata3.cpp:25:8: error: 's' was not declared in this scope if(s==n) ^ plata3.cpp:25:11: error: 'n' was not declared in this scope if(s==n) ^ plata3.cpp: In function 'void tipar(int)': plata3.cpp:32:9: error: 'i' was not declared in this scope for(i=1; i<=k; i++) ^ plata3.cpp:33:9: error: 'out' was not declared in this scope out<<sol[i]<<" "; ^ plata3.cpp:33:14: error: 'sol' was not declared in this scope out<<sol[i]<<" "; ^ plata3.cpp:34:5: error: 'out' was not declared in this scope out<<endl; ^ plata3.cpp: In function 'void back(int)': plata3.cpp:38:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ plata3.cpp:38:17: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ plata3.cpp:40:9: error: 'sol' was not declared in this scope sol[k]=i; ^ plata3.cpp:44:13: error: expected ';' before 'else' else ^ plata3.cpp: In function 'int main()': plata3.cpp:50:8: error: 'n' was not declared in this scope in>>n; ^ plata3.cpp: In function 'int solutie(int)': plata3.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Plata3 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ă.