UVA Problem 12468 ( Zapping) Solution

Problem Solving, UVa

 

#include <bits/stdc++.h>

using namespace std;

int main()

{

    int a,b,ans;

    while(cin >> a >> b)

    {

        if(a==-1 and b==-1) break;

        ans=abs(a-b);

        if(ans>50)

        ans=100-ans;

        cout<<ans<<endl;

    }

    return 0;

}

 

0 Comments

You may find interest following article