|
|
back to boardWhere is mistake?? Posted by maridom 21 Feb 2006 01:35 Hello! I don't have any errors on my computer, but when i'm trying to submit the problem i get a compilation error. Does anyone know why? Here is my code: #include <iostream> #include <string.h> using namespace std; int main() { int IloscPol,i; int MozliwoscRuchow[100]; string Pola[100];
cin>>IloscPol; for( i=0 ; i<IloscPol ; i++) { cin>>Pola[i]; if (Pola[i]=="a1" || Pola[i]=="a8" || Pola[i]=="h8" || Pola[i]=="h1" ) MozliwoscRuchow[i]=2; else if (Pola[i]=="a2" || Pola[i]=="b1" || Pola[i]=="g1" || Pola[i]=="h2" || Pola[i]=="a7" || Pola[i]=="b8" || Pola[i]=="g8" || Pola[i]=="h7") MozliwoscRuchow[i]=3; else if (Pola[i]=="a3" || Pola[i]=="a4" || Pola[i]=="a5" || Pola[i]=="a6" || Pola[i]=="c1" || Pola[i]=="d1" || Pola[i]=="e1" || Pola[i]=="f1" || Pola[i]=="c8" || Pola[i]=="d8" || Pola[i]=="e8" || Pola[i]=="f8" || Pola[i]=="h3" || Pola[i]=="h4" || Pola[i]=="h5" || Pola[i]=="h6" || Pola[i]=="b2" || Pola[i]=="b7" || Pola[i]=="g2" || Pola[i]=="g7") MozliwoscRuchow[i]=4; else if (Pola[i]=="b3" || Pola[i]=="b4" || Pola[i]=="b5" || Pola[i]=="b6" || Pola[i]=="c2" || Pola[i]=="d2" || Pola[i]=="e2" || Pola[i]=="f2" || Pola[i]=="c7" || Pola[i]=="d7" || Pola[i]=="e7" || Pola[i]=="f7" || Pola[i]=="g3" || Pola[i]=="g4" || Pola[i]=="g5" || Pola[i]=="g6") MozliwoscRuchow[i]=6; else MozliwoscRuchow[i]=8; } for (i=0 ; i<IloscPol ; i++) cout<<MozliwoscRuchow[i]<<endl; system("pause"); } Re: Where is mistake?? Posted by kef 21 Apr 2006 16:11 >>system("pause"); skasuj to :) |
|
|