Code Forces 581 A. Vasya the Hipster(水~)

Description
小明有a只红袜子和b只蓝袜子,小明喜欢一只脚红袜子一只脚蓝袜子,而小明每天换一次袜子,穿完一双袜子就扔掉,问小明最多有多少天可以一只脚红袜子一只脚蓝袜子,这些天之后小明还有多少天有袜子穿
Input
两个整数a和b
Output
输出小明穿一只红袜子一只蓝袜子的天数以及这些天之后还有多少天有袜子可以穿
Sample Input
3 1
Sample Output
1 1
Solution
纯净水~
Code

#include<stdio.h>
int main()
{
    int a,b;
    while(~scanf("%d%d",&a,&b))
    {
        int t;
        if(a<b)
            t=a,a=b,b=t;
        printf("%d %d\n",b,(a-b)/2);
    }
    return 0;
}

你可能感兴趣的:(Code Forces 581 A. Vasya the Hipster(水~))