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++: #include <stdio.h>
#include <algorithm>
using namespace std;

bool IsEqual(int* begin, int size)
{
	for (int i = 1; i < size; i++)
	{
		if (begin[i] != begin[i - 1]) return false;
	}
	return true;
}

int main()
{
	int card[5];

	while (true)
	{
		for (int i = 0; i < 5; i++)
		{
			if (scanf("%d,", &card[i]) == -1) return 0;
		}
		sort(card, card + 5);

		if	(IsEqual(card, 4)) printf("four card\n");

		else if (IsEqual(card + 1, 4)) printf("four card\n");

		else if (IsEqual(card, 3) && IsEqual(card + 3, 2)) printf("full house\n");

		else if (IsEqual(card, 2) && IsEqual(card + 2, 3)) printf("full house\n");

		else if (card[0] + 1 == card[1] && card[1] + 1 == card[2]
			  && card[2] + 1 == card[3] && card[3] + 1 == card[4]) printf("straight\n");

		else if (card[0] == 1 && card[1] == 10 && card[2] == 11
			  && card[3] == 12 && card[4] == 13) printf("straight\n");

		else if (IsEqual(card, 3) || IsEqual(card + 1, 3) || IsEqual(card + 2, 3)) printf("three card\n");

		else if (IsEqual(card, 2) && IsEqual(card + 2, 2)) printf("two pair\n");

		else if (IsEqual(card + 1, 2) && IsEqual(card + 3, 2)) printf("two pair\n");

		else if (IsEqual(card, 2) && IsEqual(card + 3, 2)) printf("two pair\n");

		else
		{
			for (int i = 0; i < 4; i++)
			{
				if (IsEqual(card + i, 2))
				{
					printf("one pair\n");
					break;
				}
				if (i == 3)
				{
					printf("null\n");
				}
			}
		}
	}

	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

struct cards{
	int num, card;
};

int main()
{
	vector<int> card(5);
	vector<int> num;
	// num, card
	while(scanf("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4]) != EOF)
	{
		sort(card.begin(), card.end());
		num.clear();

		int st = card[0];
		bool straight = true;
		for(int i = 1; i < 5; i++)
		{
			st++;
			if(st != card[i])
			{
				straight = false;
				break;
			}
		}
		if(straight)
		{
			cout << "straight" << endl;
			continue;
		}

		int cnt = 1;
		for(int i = 0; i < 5; i++)
		{
			if(card[i] == 1) card[i] = 14;
		}

		for(int i = 0; i < 5; i++)
		{
			if(card[i] == card[i+1])
			{
				cnt++;
			}
			else
			{
				num.push_back(cnt);

				cnt = 1;
			}
		}

		if(num.size() == 2)
		{
			if( num[0] == 4 || num[1] == 4)
			{
				cout << "four card" << endl;
			}
			if( num[0] == 3 && num[1] == 2 || num[0] == 2 && num[1] == 3)
			{
				cout << "full house" << endl;
			}
		}
		else if(num.size() == 3)
		{
			if( num[0] == 3 || num[1] == 3 || num[2] == 3)
			{
				cout << "three card" << endl;
			}

			else if( num[0] == 2 && num[1] == 2 || num[0] == 2 && num[2] == 2 || num[1] == 2 && num[2] == 2)
			{
				cout << "two pair" << endl;
			}
		}
		else if(num.size() == 4)
		{
			cout << "one pair" << endl;
		}
		else if(num.size() == 5)
		{
			cout << "null" << endl;
		}
	}
}

C++: #include<cstdio>
#include<iostream>
#include<cmath>

#define R 1
#define D 2
#define L 3
#define U 4

using namespace std;

int main(void){

	int card[14];
	int inp;
	int tmp;
	char gava;
	bool f1,f2,f3;

	while(cin>>inp>>gava){

		for(int i=0;i<14;i++) card[i]=0;
		card[inp]++;
		for(int i=0;i<3;i++){
			cin>>inp>>gava;
			card[inp]++;
		}
		cin>>inp;
		card[inp]++;
		f3=false;

		/*four card*/
		for(int i=0;i<14;i++){
			if(card[i]==4){
				f3=true;
				cout<<"four card"<<endl;
				break;
			}
		}
		if(f3) continue;

		/*full house*/
		f1=false,f2=false;
		for(int i=0;i<14;i++){
			if(card[i]==3) f1=true;
			if(card[i]==2) f2=true;
			if(f1==true&&f2==true){
				f3=true;
				cout<<"full house"<<endl;
				break;
			}
		}
		if(f3) continue;

		/*straight*/
		for(int i=0;i<14;i++){
			if(card[i]==0&&card[i+1]==1){
				tmp=i+1;
				f1=true;
				for(int j=0;j<5;j++){
					if(tmp==14){
						tmp=1;
						if(card[tmp+1]==1){
							f1=false;
							break;
						}
					}
					if(card[tmp]!=1) f1=false;
					tmp++;
				}
				if(f1){
					f3=true;
					cout<<"straight"<<endl;
					break;
				}
			}
		}
		if(f3) continue;

		/*three card*/
		for(int i=0;i<14;i++){
			if(card[i]==3){
				f3=true;
				cout<<"three card"<<endl;
				break;
			}
		}
		if(f3) continue;

		/*two pair */
		f1=false,f2=false;
		for(int i=0;i<14;i++){
			if(card[i]==2&&f1==false){
				f1=true;
				continue;
			}
			if(card[i]==2) f2=true;
			if(f1==true&&f2==true){
				cout<<"two pair"<<endl;
				f3=true;
				break;
			}
		}
		if(f3) continue;

		/*one pair*/
		for(int i=0;i<14;i++){
			if(card[i]==2){
				f3=true;
				cout<<"one pair"<<endl;
				break;
			}
		}
		if(f3) continue;

		/*null*/
		cout<<"null"<<endl;
	}

	return 0;
}