Wednesday, October 26, 2011

UVa Problem: Hashmat the Brave Warrior(10055)

//This C++ program is the solution to
//the problem put up on the UVa online judge
//website. The problem id is 10055
//
//Question: Hashmat the brave warrior

#include<iostream>
using namespace std;
int main()
{
long a,b;
while(cin>>a>>b)
{
if(a>b)
{
cout<<a-b<<"\n";
}
else
{
cout<<b-a<<"\n";
}
}
}
//Author of solution : Mayank Rajoria

1 comment:

  1. #include

    using namespace std;

    int main()
    {
    long int x,y;
    cin>>x>>y;
    if(x>y){
    cout<<x-y;
    }
    else{
    cout<<y-x;
    }
    return 0;
    }


    Right or wrong ?

    ReplyDelete