ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1197. Lonesome Knight

why the compile error!!!
Posted by mahbubul 28 Jun 2003 23:12
I tried to solve problem 1197. And in my computer there is no error
in compiling. Even the answer is correctly given. But the online
judge replies:

You tried to solve problem 1197. Your solution on C++ was compiled
with
the following errors:

406816
e:\Judge\vc7\include\useoldio.h(29) : warning C4995:
'_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated
temp\406816(75) : fatal error C1075: end of file found before the left
brace '{' at 'temp\406816(8)' was matched
С

I can’t understand. Where is my mistake? Will you help me? Here is my
program:

#include<iostream.h>
#include<stdio.h>

char cell[2];
int i,set,don,number,position[8],possible;

main()
{
while(cin>>set){
for(don=1;don<=set;don++){
scanf("\n%s",&cell);

 switch(cell[0])
 {
 case 'a':number=0;
      break;
 case 'b':number=10;
      break;
 case 'c':number=20;
      break;
 case 'd':number=30;
      break;
 case 'e':number=40;
      break;
 case 'f':number=50;
      break;
 case 'g':number=60;
      break;
 case 'h':number=70;
      break;
 }

 switch(cell[1])
 {
 case '1':number=number+1;
     break;
 case '2':number=number+2;
     break;
 case '3':number=number+3;
     break;
 case '4':number=number+4;
     break;
 case '5':number=number+5;
     break;
 case '6':number=number+6;
     break;
 case '7':number=number+7;
     break;
 case '8':number=number+8;
     break;
 }
position[0]=number-12;
position[1]=number+12;
position[2]=number+21;
position[3]=number-21;
position[4]=number+8;
position[5]=number-8;
position[6]=number+19;
position[7]=number-19;
possible=0;

 for(i=0;i<8;i++)
 {
 if(position[i]>0 && ((position[i]%10)!=9))  {
 if( ((position[i]%10)!=0) && position[i]<79){
 possible++;
 } } }
 number=0;
 cout<<possible<<endl;

}
}
return 0;
}
Re: why the compile error!!!
Posted by Dinu Adrian Florin 29 Apr 2004 16:27
you have a very ugly program
Read my AC source
Now it takes WA on test 1
Posted by Vlad Veselov 29 Apr 2004 18:53