#877
Gigel are un set de n
cuburi. Fiecare cub este marcat cu un număr natural, de la 1
la n
și i se cunoaște lungimea laturii – număr natural. Cu o parte dintre aceste cuburi Gigel va construi o stivă, astfel:
Să se afișeze numerele de pe cuburile existente la final în stivă, de la bază spre vârf.
Problema | Cuburi2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56739675 | Utilizator | |
Fișier | cuburi2.cpp | Dimensiune | 449 B |
Data încărcării | 04 Martie 2025, 12:59 | Scor / rezultat | Eroare de compilare |
cuburi2.cpp:4:10: error: expected unqualified-id before numeric constant { int 1,p; ^ cuburi2.cpp: In function 'int main()': cuburi2.cpp:10:12: error: 'struct cub' has no member named 'l' cin>>s[1].l; ^ cuburi2.cpp:11:7: error: 'struct cub' has no member named 'p' s[1].p=1; ^ cuburi2.cpp:13:14: error: 'struct cub' has no member named 'l' { cin>>s[i].l; ^ cuburi2.cpp:14:12: error: 'struct cub' has no member named 'l' if(s[i].l<=s[k].l) ^ cuburi2.cpp:14:20: error: 'struct cub' has no member named 'l' if(s[i].l<=s[k].l) ^ cuburi2.cpp:16:10: error: 'struct cub' has no member named 'l' s[k].l=s[i].l; ^ cuburi2.cpp:16:17: error: 'struct cub' has no member named 'l' s[k].l=s[i].l; ^ cuburi2.cpp:17:10: error: 'struct cub' has no member named 'p' s[k].p=i; ^ cuburi2.cpp:20:15: error: 'struct cub' has no member named 'l' {while(s[i].l>s[k].l && k!=0) ^ cuburi2.cpp:20:22: error: 'struct cub' has no member named 'l' {while(s[i].l>s[k].l && k!=0) ^ cuburi2.cpp:23:9: error: 'struct cub' has no member named 'l' s[k].l=s[i].l; ^ cuburi2.cpp:23:16: error: 'struct cub' has no member named 'l' s[k].l=s[i].l; ^ cuburi2.cpp:24:9: error: 'struct cub' has no member named 'p' s[k].p=i; ^ cuburi2.cpp:29:18: error: 'struct cub' has no member named 'p' cout<<s[i].p<<" "; ^ cuburi2.cpp:29:24: error: expected '}' at end of input cout<<s[i].p<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuburi2 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ă.