题目链接:http://codeforces.com/problemset/problem/378/A
题目意思:简单,给你两个数a、b,其中a、b都不大于6,然后抛色子,哪个数更接近色子的数字,那么谁就是赢家!;
解题过程:
#include<cstdio>
#include<cmath>
using namespace std;
int main(void)
{
int a,b,c;
int m,n;
int i;
a=b=c=0;
scanf("%d%d", &m, &n);
for(i=1; i<=6; ++i)
if(abs(m-i)>abs(n-i))
b++;
else if(abs(m-i)<abs(n-i))
a++;
else
c++;
printf("%d %d %d", a, c, b);
return 0;
}