也没什么好说的,就根据题意说的写就完事儿了。
#include <bits/stdc++.h>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
cin.tie(0);
cout.tie(0);
int t,ko,to;
cin >> t;
while(t--)
{
int n;
cin >> n;
ko = 0;
to = 0;
while(n--)
{
int x;
cin >> x;
if(x == 1)
ko += 1;
else if(x == 2)
to += 1;
else if(x == 3)
{
ko += 1;
to += 1;
}
else if(x == 4)
{
ko -= 1;
to -= 1;
}
}
if(ko > to)
cout << "Kobayashi" << endl;
else if(ko < to)
cout << "Tohru" << endl;
else
cout << "Draw" << endl;
}
return 0;
}
标签:3958,cout,int,ZOJ,Cooking,ko,cin,else,tie From: https://blog.51cto.com/u_16131191/6356118