Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"sort"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), ",")
		cards := make([]int, 5)
		for i :=range input {
			cards[i], _ = strconv.Atoi(input[i])
		}
		sort.Sort(sort.IntSlice(cards))
		if cards[0] == cards[1] && cards[2] == cards[3] && cards[2] == cards[1] {
			fmt.Println("four card")
		} else if cards[1] == cards[2] && cards[3] == cards[4] && cards[3] == cards[2]{
			fmt.Println("four card")
		} else if cards[0] == cards[1] && cards[1] == cards[2] && cards[3] == cards[4] {
			fmt.Println("full house")
		} else if cards[0] == cards[1] && cards[2] == cards[3] && cards[3] == cards[4] {
			fmt.Println("full house")
		} else if cards[0] == 1 && cards[1] == 10 && cards[2] == 11 && cards[3] == 12 && cards[4] == 13 {
			fmt.Println("straight")
		} else if cards[0]+1 == cards[1] && cards[1]+1 == cards[2] && cards[2]+1 == cards[3] && cards[3]+1 == cards[4] {
			fmt.Println("straight")
		} else if (cards[0] == cards[1] && cards[1] == cards[2]) || (cards[1] == cards[2] && cards[2] == cards[3]) || (cards[2] == cards[3] && cards[3] == cards[4]) {
			fmt.Println("three card")
		} else if ((cards[0] == cards[1]) && ((cards[2] == cards[3]) || (cards[3] == cards[4]))) || ((cards[1] == cards[2]) && (cards[3] == cards[4])) {
			fmt.Println("two pair")
		} else if cards[0] == cards[1] || cards[1] == cards[2] || cards[2] == cards[3] || cards[3] == cards[4] {
			fmt.Println("one pair")
		} else {
			fmt.Println("null")
		}
	}
}

C++: /* AOJ 0038*/

#include<iostream>
#include<queue>

using namespace std;

void Swap(int *a,int *b){
	int tmp = *a;
	*a = *b;
	*b = tmp;
}

void BabbleSort(int *data,int n){

	int i,j;
	for(i=0;i<n-1;i++){
		for(j=n-1;j>i;j--){
			if(data[j] <= data[j-1]){
				Swap(&data[j],&data[j-1]);
			}
		}
	}

}

//onePair or threeCards or fourCards
int isSameCard(int *data){
	
	int tmp[13];

	for(int i=0;i<13;i++){
		tmp[i] = 0;
	}

	for(int i=0;i<5;i++){
		tmp[data[i]-1]++;
	}

	BabbleSort(tmp,13);

	if(tmp[12]==3 && tmp[11] == 2){
		return 6;//フルハウス
	}
	else if(tmp[12] == 4){
		return 7;//フォーカード
	}
	else if(tmp[12] == 3){
		return 4;
	}
	else if(tmp[12] == 2 && tmp[11] == 2){
		return 3;
	}
	else if(tmp[12] == 2){
		return 2;
	}
	else{
		return 1;
	}
}

int isStraight(int *data){
	
	int tmp[13];

	for(int i=0;i<13;i++){
		tmp[i] = 0;
	}

	for(int i=0;i<5;i++){
		tmp[data[i]-1]++;
	}

	if(tmp[9] == 1 && tmp[10] == 1 && tmp[11] == 1 && tmp[12]==1 && tmp[0]==1){
		return 5;
	}
	else{
		for(int i=0;i<13-5;i++){
			if(tmp[i]==1&&tmp[i+1]==1&&tmp[i+2]==1&&tmp[i+3]==1&&tmp[i+4]==1){
				return 5;
			}
		}
	}

	return 1;
}

int main(){

	int data[5];
	char tmp;

	queue<int> ans;

	while(cin>>data[0]){
		cin>>tmp;
		cin>>data[1];
		cin>>tmp;
		cin>>data[2];
		cin>>tmp;
		cin>>data[3];
		cin>>tmp;
		cin>>data[4];

		BabbleSort(data,5);

		if(isSameCard(data)>=2){
			ans.push(isSameCard(data));
		}
		else{
			ans.push(isStraight(data));
		}

	}

	int size=ans.size();

	for(int i=0;i<size;i++){
		switch(ans.front()){
		case 7:
			cout<<"four cards"<<endl;
			break;
		case 6:
			cout<<"full house"<<endl;
			break;
		case 5:
			cout<<"straight"<<endl;
			break;
		case 4:
			cout<<"three cards"<<endl;
			break;
		case 3:
			cout<<"two pair"<<endl;
			break;
		case 2:
			cout<<"one pair"<<endl;
			break;
		case 1:
			cout<<"null"<<endl;
			break;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <array>
#include <string>
#include <vector>
#include <unordered_map>
#include <sstream>

using namespace std;

vector< std::string > split( const std::string &str, char delm )
{
	std::vector< std::string > v;
	std::stringstream ss( str );
	std::string buffer;
	while ( std::getline( ss, buffer, delm ) )
	{
		if ( buffer == "A" )
			buffer = "1";
		else if ( buffer == "J" )
			buffer = "11";
		else if ( buffer == "Q" )
			buffer = "12";
		else if ( buffer == "K" )
			buffer = "13";

		v.push_back( buffer );
	}

	return v;
}

std::string maxthree( std::unordered_map< std::string, int > ump )
{
	if ( ump.size() == 2 )
	{
		return "full house";
	}
	else 
	{
		return "three card";
	}
}

std::string maxone( std::unordered_map< std::string, int > ump )
{
	array< int, 5 > ar;
	int i = 0, tmp = 0;
	auto itr = ump.begin();
	const char * ch;

	for ( ; itr != ump.end() ; itr++ )
	{
		ch = itr->first.c_str();
		ar[i] = atoi( ch );
		i++;
	}

	for ( int j = 0 ; j < 5 ; j++ )
	{
		for ( int k = j+1 ; k < 5 ; k++ )
		{
			if ( ar[j] > ar[k] )
			{
				tmp = ar[j];
				ar[j] = ar[k];
				ar[k] = tmp;
			}
		}
	}

	if ( ar[0]+1 == ar[1] && ar[0]+2 == ar[2] && ar[0]+3 == ar[3] && ar[0]+4 == ar[4] )
	{
		return "straight";
	}
	else 
	{
		if ( ar[0] == 1 && ar[1] == 10 && ar[2] == 11 && ar[3] == 12 && ar[4] == 13 )
			return "straight";
		else 
			return "null";
	}
}

std::string maxtwo( std::unordered_map< std::string, int > ump )
{
	if ( ump.size() == 4 )
	{
		return "one pair";
	}
	else 
	{
		return "two pair";
	}
}

int main()
{
	int max = 0;
	vector< std::string > str_v;
	unordered_map< std::string, int > ump;
	string str;

	while ( cin >> str )
	{
		str_v = split( str, ',' );	
		for ( int i = 0 ; i < 5 ; i++ )
		{
			ump[str_v[i]]++;
		}

		auto itr = ump.begin();
		for ( ; itr != ump.end() ; itr++ )
		{
			if ( itr->second > max )
			{
				max = itr->second;
			}
		}

		if ( max == 1 )
			cout << maxone( ump ) << endl;
		else if ( max == 2 )
			cout << maxtwo( ump ) << endl;
		else if ( max == 3 )
			cout << maxthree( ump ) << endl;
		else if ( max == 4 )
			cout << "four card" << endl;

		max = 0;
		ump.clear();
	}

	return 0;
}

C++: #include<bits/stdc++.h>

using namespace std;

int main(){

  vector<int> card(5);
  
  while(scanf("%d,%d,%d,%d,%d",&card[0],&card[1],&card[2],&card[3],&card[4]) != EOF){
	bool judge_1p = false;
	bool judge_2p = false;
	bool judge_3 = false;
	bool judge_4 = false;
	bool judge_s = false;

	sort(card.begin(),card.end());
	
	for(int i=0;i<4;++i){
	  int count = 1;
	  for(int j=i+1;j<5;++j){
		if(card[i] == card[j]){
		  count++;
		  if(j == 4)
			i = j - 1;
		}
		else{
		  i = j - 1;
		  break;
		}
	  }
	  
	  if(count == 2){
		if(judge_1p == false)
		  judge_1p = true;
		else if(judge_1p == true)
		  judge_2p = true;
	  }
	  else if(count == 3)
		judge_3 = true;
	  else if(count == 4)
		judge_4 = true;
	  
	}

	if(card[0] == 1 && card[1] == 10 &&
	   card[2] == 11 && card[3] == 12 &&
	   card[4] == 13){
	  cout<<"straight"<<endl;
	  continue;
	} 
	
	for(int i=0;i<4;++i){
	  if(card[i] == card[i+1] - 1 && i == 3)
		judge_s = true;
		
	  else if(card[i] != card[i+1] - 1)
		break;
	}

	if(judge_4 == true)
	  cout<<"four card"<<endl;
	else if(judge_3 == true && judge_1p == true)
	  cout<<"full house"<<endl;
	else if(judge_3 == true)
	  cout<<"three card"<<endl;
	else if(judge_2p == true)
	  cout<<"two pair"<<endl;
	else if(judge_1p == true)
	  cout<<"one pair"<<endl;
	else if(judge_s == true)
	  cout<<"straight"<<endl;
	else
	  cout<<"null"<<endl;
  }
  
}