ITP1_9_C: Card Game

http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_C
カードゲームの得点を計算する問題。

#include <iostream>
#include <string>
using namespace std;

int main() {
int n,t1=0,h1=0;
std::string t,h;
std::cin>>n;
while(n--){
	std::cin>>t>>h;
	if(t<h){
		h1+=3;
	}else if(t>h){
		t1+=3;
	}else{
		h1++;
		t1++;
	}
}
std::cout<<t1<<" "<<h1<<"\n";
}
最終更新:2016年03月22日 15:55