|  | 
|  | 
| back to board | Why my program get Complier Error?(My answer is right,i think!!) This is my program:
 [code deleted]
 
 Edited by moderator 10.03.2006 09:30
Because your're using variable i after loop (+) And MS VS allows that, while gcc doesn't.
 for(i=1;i<n-1;i++) -> for(long int i=1;i<n-1;i++)
 
 P.S. You can use the proper radio button to get a report from automatic judge. Here's what I got for submitting your code as p1000:
 
 ==
 
 Dear Michael Rybak (accepted@ukr.net),
 
 You tried to solve problem 1000 A+B Problem.
 Your solution was compiled with the following errors:
 
 ea11b624-4b75-4ac3-949f-d673815bc479
 temp\ea11b624-4b75-4ac3-949f-d673815bc479(10): error: identifier "i" is undefined
 for(i=1;i<n-1;i++)
 ^
 
 temp\ea11b624-4b75-4ac3-949f-d673815bc479(27): warning #1: last line of file ends without a newline
 }
 ^
 
 compilation aborted for temp\ea11b624-4b75-4ac3-949f-d673815bc479 (code 2)
 | 
 | 
|