Thursday, September 27, 2018

Solution of URI 1198::Hashmat the Brave Warrior

Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problemyou will inform me by comment.




#include <bits/stdc++.h>
using namespace std;

int main(){
    long long int hs,os,ds;

    while(cin>>hs>>os) {
        ds=hs>os?(hs-os):(os-hs);
        cout<<ds<<endl;
    }

    return 0;
}

No comments:

Post a Comment