#2178
Furnica
Pe o tablă de şah cu n
linii şi n
coloane se află firimituri de pâine şi o furnică. Pentru fiecare pătrăţel, inclusiv cel în care se găseşte furnica, aflat pe linia i
şi coloana j
, cantitatea de firimituri de pâine este egală cu restul împărţirii lui i+j la 6
.
OJI 2007, Clasa a VI-a
Problema | Furnica | Operații I/O |
![]() furnica.in /furnica.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #47744836 | Utilizator | |
Fișier | furnica.cpp | Dimensiune | 1.31 KB |
Data încărcării | 30 Decembrie 2023, 16:51 | Scor / rezultat | Eroare de compilare |
furnica.cpp:67:1: error: stray '\342' in program 74 <<’\n’; ^ furnica.cpp:67:1: error: stray '\200' in program furnica.cpp:67:1: error: stray '\231' in program furnica.cpp:67:1: error: stray '\' in program furnica.cpp:67:1: error: stray '\342' in program furnica.cpp:67:1: error: stray '\200' in program furnica.cpp:67:1: error: stray '\231' in program furnica.cpp:69:1: error: stray '\342' in program 76 g<<maxi<<’\n’; ^ furnica.cpp:69:1: error: stray '\200' in program furnica.cpp:69:1: error: stray '\231' in program furnica.cpp:69:1: error: stray '\' in program furnica.cpp:69:1: error: stray '\342' in program furnica.cpp:69:1: error: stray '\200' in program furnica.cpp:69:1: error: stray '\231' in program furnica.cpp:71:1: error: stray '\342' in program 78 g<<cladire<<’\n’; ^ furnica.cpp:71:1: error: stray '\200' in program furnica.cpp:71:1: error: stray '\231' in program furnica.cpp:71:1: error: stray '\' in program furnica.cpp:71:1: error: stray '\342' in program furnica.cpp:71:1: error: stray '\200' in program furnica.cpp:71:1: error: stray '\231' in program furnica.cpp:1:1: error: 'ifstream' does not name a type ifstream f("furnica.in"); ^ furnica.cpp:2:2: error: 'ofstream' does not name a type ofstream g("furnica.out"); ^ furnica.cpp: In function 'int main()': furnica.cpp:11:2: error: 'f' was not declared in this scope f>>cerinta>>n; ^ furnica.cpp:43:4: error: expected ';' before '{' token 50 { ^ furnica.cpp:47:4: warning: statement has no effect [-Wunused-value] 54 } ^ furnica.cpp:48:4: error: expected ';' before '}' token 55 } ^ furnica.cpp:48:4: warning: statement has no effect [-Wunused-value] furnica.cpp:49:4: error: expected ';' before 'if' 56 if (TIMP>0) ^ furnica.cpp:54:4: warning: statement has no effect [-Wunused-value] 61 } ^ furnica.cpp:55:4: error: expected ';' before 'if' 62 if (lungime>maxi) ^ furnica.cpp:56:16: warning: statement has no effect [-Wunused-value] 63 maxi=lungime; ^ furnica.cpp:57:4: error: expected ';' before 'H1' 64 H1=H; ^ furnica.cpp:57:8: warning: statement has no effect [-Wunused-value] 64 H1=H; ^ furnica.cpp:58:4: error: expected ';' before 'L1' 65 L1=L; ^ furnica.cpp:58:8: warning: statement has no effect [-Wunused-value] 65 L1=L; ^ furnica.cpp:59:4: error: expected ';' before '}' token 66 } ^ furnica.cpp:59:4: warning: statement has no effect [-Wunused-value] furnica.cpp:60:4: error: expected ';' before 'if' 67 if (TIMP>0) ^ furnica.cpp:62:13: warning: statement has no effect [-Wunused-value] 69 cladire=n; ^ furnica.cpp:63:4: error: expected ';' before 'else' 70 else cladire=-1; ^ furnica.cpp:63:19: warning: statement has no effect [-Wunused-value] 70 else cladire=-1; ^ furnica.cpp:65:1: error: expected ';' before numeric constant 72 if (cerinta==1) ^ furnica.cpp:67:14: warning: statement has no effect [-Wunused-value] 74 <<’\n’; ^ furnica.cpp:68:4: error: expected ';' before 'else' 75 else if (cerinta==2) ^ furnica.cpp:69:21: warning: statement has no effect [-Wunused-value] 76 g<<maxi<<’\n’; ^ furnica.cpp:70:4: error: expected ';' before 'else' 77 else if (cerinta==3) ^ furnica.cpp:71:24: warning: statement has no effect [-Wunused-value] 78 g<<cladire<<’\n’; ^ furnica.cpp:72:4: error: expected ';' before 'return' 79 return 0; ^ furnica.cpp:72:12: warning: statement has no effect [-Wunused-value] 79 return 0; ^ furnica.cpp:73:4: error: expected ';' before '}' token 80 } ^ furnica.cpp:73:4: warning: statement has no effect [-Wunused-value]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Furnica 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ă.