标签:class inner c++ for turn pre == bit int
这题好简单,可以分析一下,没有别的情况了。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int p1,p2,c[3];
int a=0,b=0;
scanf("%d%d%d%d%d",&p1,&p2,&c[0],&c[1],&c[2]);
for (int i=0;i<3;i++) {
if (c[i]==0) {
a++;
}
else {
b++;
}
}
if (p1>p2&&a) {
printf("The winner is a: %d + %d\n",p1,a);
}
else if (p2>p1&&b) {
printf("The winner is b: %d + %d\n",p2,b);
}
else if (a==3&&p1<p2) {
printf("The winner is a: %d + %d\n",p1,a);
}
else if (b==3&&p2<p1) {
printf("The winner is b: %d + %d\n",p2,b);
}
return 0;
}
标签:class inner c++ for turn pre == bit int
原文地址:https://www.cnblogs.com/xyqxyq/p/12336825.html