My first post about ACM problem

Hi, Guys this is my first post about acm problems. As this is my first post I am going to publish one of my AC code. It’s a very easy problem. But the title seems to be horrible. You just calculate the difference between the input and print the output.

The solution of problem No. 10055

The code:

//10055.cpp

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

int main() {
double a,b;
while (cin>>a>>b) {
if (a>b) printf(“%.0f\n”,a-b);
else printf(“%.0f\n”,b-a);
}
return 0;
}

Just copy n paste it. You will get accepted.

About these ads
Leave a comment

1 Comment

  1. Congrets joy for your first success. But why you used double ? You may do it by unsigned long.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: