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 "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

vector<string> split(const string &str, char delim) {
	vector<string> res;
	size_t current = 0, found;
	while ((found = str.find_first_of(delim, current)) != string::npos) {
		res.push_back(string(str, current, found - current));
		current = found + 1;
	}
	res.push_back(string(str, current, str.size() - current));
	return res;
}

struct Card {
	int type;
	int num;
	Card(const int _type, const int _num) :type(_type), num(_num) {
		assert(type >= 0 && type <= 3);
		assert(num >= 1 && num <= 13);
	}
	Card() :type(-1), num(-1) {

	}
	bool operator <(const Card& c) {
		return num == c.num ? type < c.type : num < c.num;
	}
};
long long int powint(long long int a, long long int b) {
	assert(b >= 0);
	if (b == 0)return 1;
	if (b == 1)return a;
	long long int ans = 1;
	long long int aa = powint(a, b / 2);
	ans *= aa*aa;
	if (b % 2)ans *= a;
	return ans;
}
struct Poker {
	vector<Card>cards;
	const long long int rolevalue = 1e16;
	long long getnumpower(
		const vector<pair<int, int>>&numcount) {

		long long int apower = 0;
		for (int i = 0; i < numcount.size(); ++i) {
			apower += numcount[i].second*powint(100, numcount.size() - 1 - i);
		}
		return apower;
	}
	long long getpower() {
		sort(cards.begin(), cards.end());
		bool isflush = false;
		{
			const int type0 = cards[0].type;
			isflush =
				all_of(cards.begin(), cards.end(), [=](const Card&c) {return c.type == type0; });
		}
		bool isstraight = false;
		{
			const int amin = cards[0].num;
			int place = -1;
			isstraight =
				all_of(cards.begin(), cards.end(), [=, &place](const Card&c) {place++; return c.num == amin + place; });
			bool royalok = true;
			for (int i = 0; i < 5; ++i) {
				if (i != 0) {
					if (cards[i].num != 9 + i) {
						royalok = false;
						break;
					}
				}
				else {
					if (cards[i].num != 1) {
						royalok = false;
						break;
					}
				}
			}
			if (royalok) {
				isstraight = true;
			}
			if (isstraight) {
				int a = 0;
				a++;
			}
		}
		vector<pair<int, int>>numcount;
		{
			map<int, int>powermp =
			{
				{ 1,14 },
				{ 2,2 },
				{ 3,3 },
				{ 4,4 },
				{ 5,5 },
				{ 6,6 },
				{ 7,7 },
				{ 8,8 },
				{ 9,9 },
				{ 10,10 },
				{ 11,11 },
				{ 12,12 },
				{ 13,13 },
			};
			vector<int>allnumcount(13);
			for (int i = 0; i < cards.size(); ++i) {
				allnumcount[cards[i].num - 1]++;
			}
			for (int i = 0; i < 13; ++i) {
				if (allnumcount[i]) {
					numcount.emplace_back(allnumcount[i], powermp[i + 1]);
				}
			}
			sort(numcount.begin(), numcount.end(), greater<pair<int, int>>());
		}



		//straightflush
		if (isstraight&&isflush) {
			assert(numcount.size() == 5);
			if (cards[0].num == 1 && cards[1].num == 10)return 10 * rolevalue + 100;
			return 10 * rolevalue + cards[0].num;
		}

		//fourcard
		if (numcount[0].first == 4) {
			assert(numcount.size() == 2);
			return 9 * rolevalue + getnumpower(numcount);
		}

		//fullhouse
		if (numcount[0].first == 3 && numcount[1].first == 2) {
			assert(numcount.size() == 2);
			return 8 * rolevalue + getnumpower(numcount);
		}
		//flush
		if (isflush) {
			assert(numcount.size() == 5);
			return 7 * rolevalue + getnumpower(numcount);
		}
		//straight
		if (isstraight) {
			assert(numcount.size() == 5);
			if (cards[0].num == 1 && cards[1].num == 10)return 6 * rolevalue + 100;
			return 6 * rolevalue + cards[0].num;
		}
		//three of a kind
		if (numcount[0].first == 3) {
			assert(numcount.size() == 3);
			return 5 * rolevalue + getnumpower(numcount);
		}
		// two pair
		if (numcount[0].first == 2 && numcount[1].first == 2) {
			assert(numcount.size() == 3);
			return 4 * rolevalue + getnumpower(numcount);
		}
		//one pair
		if (numcount[0].first == 2) {
			assert(numcount.size() == 4);
			return 3 * rolevalue + getnumpower(numcount);
		}
		// no pair
		assert(numcount.size() == 5);
		return 2 * rolevalue + getnumpower(numcount);
	}
	Poker(vector<Card>_cards) :cards(_cards) {}
};
int main() {
	string st;
	map<int, string>mp;
	
	while (cin >> st) {
		vector<string>sts;
		sts = split(st, ',');
		vector<Card>cs;
		for (int i = 0; i < sts.size(); ++i) {
			int num = stoi(sts[i]);
			cs.push_back(Card(i%4, num));
		}
		Poker po(cs);
		int n = po.getpower() / po.rolevalue;
		mp[2] = "null";
		mp[3] = "one pair";
		mp[4] = "two pair";
		mp[5] = "three card";
		mp[6] = "straight";
		mp[8] = "full house";
		mp[9] = "four card";
		cout << mp[n] << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))

bool st(int h[5]){
	bool f=true;
	rep(i,4)if(h[i+1]-h[i]!=1)f=false;
	return f;
}

int main(){
	int h[5],c[5],a,*e;
	char *s[]={
		"null","one pair","two pair","three card","straight","full house","four card",
	};
	while(~scanf("%d,%d,%d,%d,%d",h,h+1,h+2,h+3,h+4)){
		sort(h,h+5);
		if(h[0]==0)break;
		a=0;
		rep(i,5)c[i]=count(h,h+5,h[i]);
		int d=count(c,c+5,2);
		if(d==4)a=2;
		e=unique(c,c+5);
		sort(c,e);
		if(*(e-1)==4)a=6;
		else if(*c==2 && c[1]==3)a=5;
		else if(*(e-1)==3)a=3;
		else if(*(e-1)==2 && d==2)a=1;
		bool f=st(h);
		if(!f){
			rotate(h,h+1,h+5);
			replace(h,h+5,1,14);
			f=st(h);
		}
		if(f)a=4;
		puts(s[a]);
	}
	
	return 0;
}