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 <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int INF = 1e9+7;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repab(i,a,b) for(auto i=a;i<(b);i++)
#define rep(i,b) for(auto i=0;i<(b);i++)
#define pb push_back
#define sz(c) int((c).size())

enum {
  FOUR_CARD,
  FULL_HOURSE,
  STRAIGHT,
  THREE_CARD,
  TWO_PAIR,
  ONE_PAIR,
  NULL_HAND,
} hands;

int check(map<int, int> m)
{
  int maxnr = 0;
  int minnr = INF;
  int maxv = 0;
  int minv = INF;
  int maxnr_count = 0;
  tr (m, i) {
    if (maxnr < i->second) {
      maxnr_count=1;
      maxnr = i->second;
    } else if (maxnr == i->second) {
      maxnr_count++;
    }
    minnr = min(minnr, i->second);
    maxv = max(maxv, i->first);
    minv = min(minv, i->first);
  }
  if (maxnr == 4)
    return FOUR_CARD;
  if (maxnr == 3 && minnr == 2)
    return FULL_HOURSE;
  if (minnr == 1 && maxnr == 1) {
    if ((maxv - minv == 4) || (m[10] && m[11] && m[12] && m[13] && m[1]))
      return STRAIGHT;
  }
  if (maxnr == 3)
    return THREE_CARD;
  if (maxnr == 2) {
    if (maxnr_count == 2)
      return TWO_PAIR;
    else
      return ONE_PAIR;
  }

  return NULL_HAND;
}
void phand(map<int, int> m)
{
  vector<string> hand_name = {
    "four card",
    "full house",
    "straight",
    "three card",
    "two pair",
    "one pair",
    "null",
  };
  cout << hand_name[check(m)] << endl;
}

int main(int argc, char **argv)
{
  vi v;
  map<int, int> m;
  char c;
  int x, minval;

  for (;;) {
    v.clear();
    m.clear();
    rep (i, 4) {
      cin >> x;
      cin >> c;
      v.pb(x);
    }
    cin >> x;
    v.pb(x);
    if (cin.eof())
      break;

    rep (i, 5) {
      m[v[i]]++;
    }
    phand(m);
  }
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>

using namespace std;

int main(){
  vector<int> c(5);
  while(~scanf("%d", &c[0])){
    int p = 0; int tc = 0;
    for(int i = 1; i < 5; i++) scanf(",%d", &c[i]);
    sort(c.begin(), c.end());
    for(int i = 0; i < 5; i++){
      if(i != 0 && c[i] == c[i-1])p++;
      if(i != 1 && c[i] == c[i-2])tc++;
    }
    if(p == 1) puts("one pair");
    else if(tc == 1 && p == 3)puts("full house");
    else if(tc && p == 2) puts("three card");
    else if(p == 2)  puts("two pair"); 
    else if(p == 3) puts("four card");
    else if(c[4] - c[0] == 4 || (c[0] == 1 && c[1] == 10 && c[4] == 13)) puts("straight");
    else puts("null");
  }
  return 0;
}

C++: #include <iostream>
#include <map>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>

using namespace std;


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;
}

int main()
{
	string s;
	while(cin >> s)
	{
		vector<string> _s = split(s,',');
		vector<int> a,b;
		map<int,int> counter;
		for(int i=0;i<_s.size();i++)
		{
			a.push_back(atoi(_s[i].c_str()));
		}
		sort(a.begin(),a.end());

		for(int i=0;i<a.size();i++)
		{
			counter[a[i]]++;

			if(b.empty())
			{
				b.push_back(a[i]);
			}
			else
			{
				bool flag = true;
				for(int j=0;j<b.size();j++)
				{
					if(b[j] == a[i])	flag = false;
				}
				if(flag) b.push_back(a[i]);
			}
		}

		//cout << b.size() << endl
		bool ans_f = true;
		for(int i=0; i<counter.size();i++)
		{
			if(counter[b[i]] == 4) cout << "four card" << endl;
		}

		for(int i=0;i<counter.size();i++)
		{
			if(counter[b[i]] == 3)
			{
				for(int j=0; j<counter.size();j++)
				{
					if(counter[b[j]] == 2) 
					{
						cout << "full house" << endl;
						ans_f = false;
						break;
					}
					else
					{
						cout << "three card" << endl;
						ans_f = false;
						break;
					}
				}
			}
		}

		for(int i=0;i<counter.size();i++)
		{
			if(counter[b[i]] == 2 && ans_f)
			{
				for(int j=0;j<counter.size();j++)
				{
					if(i != j && counter[b[j]] == 2 && ans_f)
					{
						cout << "two pair" << endl;
						ans_f = false;
						break;
					}
				}
				if(ans_f) 
				{
					cout << "one pair" << endl;
				}
			}
		}

		if(counter.size() == 5)
		{
			int temp = b[0];
			if(b[1] == temp+1 && b[2] == temp+2 && b[3] == temp+3 && b[4] == temp+4)
			{
				cout << "straight" << endl;
			}
			else if(temp == 1 && b[1] == 10 && b[2] == 11 && b[3] == 12 && b[4] == 13)
			{
				cout << "straight" << endl;
			}
			else
			{
				cout << "null" << endl;
			}
		}

	}
	return 0;
}

C++: #include<stdio.h>
using namespace std;
int main(void)
{
	int c[5],cnt[15],i,j,yaku,flg,flg2,n;
	char yak[8][11]={"","null","one pair","two pair","three card",
						"straight","full house","four card"};
						
	while(scanf("%d,%d,%d,%d,%d",&c[0],&c[1],&c[2],&c[3],&c[4])!=EOF)	{
		for(i=1;i<=14;i++)	cnt[i]=0;
		for(i=0;i<5;i++)	{
			if(c[i]==1)	cnt[14]++;
			cnt[c[i]]++;
		}
//		for(i=2;i<=14;i++)	{
//			printf(" kazu=%d\n",cnt[i]);
//		}
		yaku=1;
		for(i=2;i<=14;i++)	{
			if(cnt[i]==4)	{
				yaku=7;
				break;
			}
		}
		if(yaku==1)	{
			flg=0;	flg2=0;
			for(i=2;i<=14;i++)	{
				if(cnt[i]==3)	{
					flg=1;
				}
				if(cnt[i]==2)	{
					flg2=1;
				}
			}
			if(flg==1 && flg2==1)	{
				yaku=6;
			}
		}
		if(yaku==1)	{
			for(i=1;i<=10;i++)	{
				flg=1;
				for(j=0;j<5;j++)	{
					if(cnt[i+j]!=1)	{
						flg=0;
						break;
					}
				}
				if(flg==1)	{
					yaku=5;
					break;
				}
			}
		}
		if(yaku==1)	{
			for(i=2;i<=14;i++)	{
				if(cnt[i]==3)	{
					yaku=4;
					break;
				}
			}
		}
		if(yaku==1)	{
			n=0;
			for(i=2;i<=14;i++)	{
				if(cnt[i]==2)	{
					n++;
				}
			}
			if(n==2)	{
				yaku=3;
			}
			else if(n==1)	{
				yaku=2;
			}
		}
		printf("%s\n",yak[yaku]);
	}
	return 0;
}