#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int a, b, change, change1, change2;
while(scanf("%d%d", &a, &b)==2)
{
if(a==-1 && b==-1)
{
break;
}
if(a>=b)
{
change1=(100-a)+b;
change2=a-b;
if(change1>change2)
{
change=change2;
}
else
{
change=change1;
}
}
if(b>a)
{
change1=((100-b)+a);
change2=b-a;
if(change1>change2)
{
change=change2;
}
else
{
change=change1;
}
}
printf("%d\n", change);
}
}
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int a, b, change, change1, change2;
while(scanf("%d%d", &a, &b)==2)
{
if(a==-1 && b==-1)
{
break;
}
if(a>=b)
{
change1=(100-a)+b;
change2=a-b;
if(change1>change2)
{
change=change2;
}
else
{
change=change1;
}
}
if(b>a)
{
change1=((100-b)+a);
change2=b-a;
if(change1>change2)
{
change=change2;
}
else
{
change=change1;
}
}
printf("%d\n", change);
}
}
No comments:
Post a Comment