#1905
snooker1
Dan și Paul și-au propus să învețe să joace snooker și la sfârșitul jocului cei doi prieteni studiază tabela de scor care arată în felul următor: apare valoarea 1
dacă un jucător a introdus o bilă roșie, o valoare cuprinsă între 1
și 6
dacă introduce corect o bilă colorată și valoarea -5
dacă jucătorul comite fault. Când un jucător ratează pe tabelă apare valoarea 0
.
După joc, cei 2
prieteni vor să afle răspunsul la următoarele întrebări:
care dintre ei a câștigat partida și care este numărul maxim de bile introduse consecutive de un jucător fără a comite fault?
Problema | snooker1 | Operații I/O |
snooker1.in /snooker1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54860065 | Utilizator | |
Fișier | snooker1.cpp | Dimensiune | 810 B |
Data încărcării | 10 Decembrie 2024, 16:25 | Scor / rezultat | Eroare de compilare |
snooker1.cpp: In function 'int main()': snooker1.cpp:9:8: error: 'n' was not declared in this scope f>>n; ^ snooker1.cpp:10:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ snooker1.cpp:12:12: error: 'v' was not declared in this scope f>>v[i]; ^ snooker1.cpp:14:5: error: 't' was not declared in this scope t=1; ^ snooker1.cpp:15:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ snooker1.cpp:17:12: error: 'v' was not declared in this scope if(v[i] and t%2==1) ^ snooker1.cpp:19:13: error: 's' was not declared in this scope s+=v[i]; ^ snooker1.cpp:20:13: error: 'l' was not declared in this scope l++; ^ snooker1.cpp:22:12: error: 'v' was not declared in this scope if(v[i] and t%2==0) ^ snooker1.cpp:24:13: error: 's2' was not declared in this scope s2+=v[i]; ^ snooker1.cpp:25:13: error: 'l2' was not declared in this scope l2++; ^ snooker1.cpp:27:12: error: 'v' was not declared in this scope if(v[i]==0 or v[i]==-5) ^ snooker1.cpp:29:16: error: 'l' was not declared in this scope if(l>maxx and v[i]!=-5) ^ snooker1.cpp:29:18: error: 'maxx' was not declared in this scope if(l>maxx and v[i]!=-5) ^ snooker1.cpp:31:16: error: 'l2' was not declared in this scope if(l2>maxx and v[i]1=-5) ^ snooker1.cpp:31:19: error: 'maxx' was not declared in this scope if(l2>maxx and v[i]1=-5) ^ snooker1.cpp:31:32: error: expected ')' before numeric constant if(l2>maxx and v[i]1=-5) ^ snooker1.cpp:34:13: error: 'l' was not declared in this scope l=0; ^ snooker1.cpp:35:13: error: 'l2' was not declared in this scope l2=0; ^ snooker1.cpp:38:8: error: 'l' was not declared in this scope if(l>maxx) ^ snooker1.cpp:38:10: error: 'maxx' was not declared in this scope if(l>maxx) ^ snooker1.cpp:40:8: error: 'l2' was not declared in this scope if(l2>maxx) ^ snooker1.cpp:40:11: error: 'maxx' was not declared in this scope if(l2>maxx) ^ snooker1.cpp:42:8: error: 's' was not declared in this scope if(s>s2) ^ snooker1.cpp:42:10: error: 's2' was not declared in this scope if(s>s2) ^ snooker1.cpp:46:8: error: 'maxx' was not declared in this scope g<<maxx; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema snooker1 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ă.