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

I am puzzled.... help me.
Posted by liwx988 12 May 2009 22:25
my solution code :

#include <stdio.h>
void main()
{
double a,b,c;
scanf("%lf%lf", &a, &b);
c=a+b;
printf("%f\n", c);
}


The result is: Wrong answer
why?
I don't know where the wrong ,please briefly tell me.
THX!

Edited by author 12.05.2009 22:34
use int instead of double
Posted by Akaishuichi 16 May 2009 16:38


Edited by author 16.05.2009 16:43
Re: I am puzzled.... help me.
Posted by mk8 8 Jul 2009 17:03
Use int (not double)
Re: I am puzzled.... help me.
Posted by laiwing 7 Aug 2009 10:13
printf("%f\n", c);

It should be %lf not %f
because c is double not float