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 1000. A+B Problem

Wrong answer 1
Posted by Eugene Mironenko 17 Mar 2012 19:41
#include <stdio.h>
main(){
    int a,b;
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    scanf("%d %d",&a, &b);
    printf("%d",a+b);
           }

Why I had wrong answer? In Visual Studio working perfectly!

Edited by author 17.03.2012 19:46

Edited by author 17.03.2012 19:46
Re: Wrong answer 1
Posted by russinow 20 Mar 2012 01:31
#include <stdio.h>
int main()
{
#ifndef ONLINE_JUDGE
   freopen("input.txt", "rt", stdin);
   freopen("output.txt", "wt", stdout);
#endif
   int a, b;
   scanf("%d%d", &a, &b);
   printf("%d\n", a + b);
   return 0;
}