[CF]581A - Vasya the Hipster
題目:
http://codeforces.com/problemset/problem/581/A
-------------------------------------------------------------------------
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF)
{
int mxn = 0, mn = 0;
if(a == b)
printf("%d %d\n",a,0);
else
{
mxn = max(a,b);
mn = min(a,b);
mxn -= mn;
printf("%d %d\n",mn,mxn/2);
}
}
return 0;
}
http://codeforces.com/problemset/problem/581/A
-------------------------------------------------------------------------
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int a,b;
while(scanf("%d%d",&a,&b)!=EOF)
{
int mxn = 0, mn = 0;
if(a == b)
printf("%d %d\n",a,0);
else
{
mxn = max(a,b);
mn = min(a,b);
mxn -= mn;
printf("%d %d\n",mn,mxn/2);
}
}
return 0;
}
留言
張貼留言