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 1010. Discrete Function

Why my program get Complier Error?(My answer is right,i think!!)
Posted by xiechuanzi 9 Mar 2006 17:20
This is my program:

[code deleted]

Edited by moderator 10.03.2006 09:30
Because your're using variable i after loop (+)
Posted by Michael Rybak (accepted@ukr.net) 9 Mar 2006 17:27
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)