#include <iostream>
using namespace std;
int A,B;
int n;
int a,b,c,d;
int j,y;
int main()
{
cin >> A >> B;
cin >> n;
int ying = 0;
while(n --)
{
cin >> a >> b >> c >> d;
int e = a + c;
if(ying != 0){
continue;
}
if(e == b && e == d){
j++;
y++;
}
else if(e == b){
j++;
}
else if(e == d){
y++;
}
if(j >= A){
ying = 2;
}
if(j >= B){
ying = 1;
}
}
if(ying == 1){
cout << 'A' << endl;
cout << y << endl;
}
else{
cout << 'B' << endl;
cout << j << endl;
}
return 0;
}
结果只是得了14分,主要是题意还是没读明白
7-2 重要的话说三遍
题意:把一串字符串输出三遍就好了
#include <iostream>
using namespace std;
int A,B;
int n;
int a,b,c,d;
int j,y;
int main()
{
printf("I'm gonna WIN!\n");
printf("I'm gonna WIN!\n");
printf("I'm gonna WIN!\n");
return 0;
}
7-3 奇偶分家
题意:给定N个正整数,请统计奇数和偶数各有多少个?
#include <iostream>
using namespace std;
int main()
{
int n;
int odd = 0;
cin >> n;
for(int i = 0;i < n;i ++)
{
int x;
cin >> x;
if(x & 1){
odd++;
}
}
cout << odd << ' ' << n - odd << endl;
return 0;
}