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 <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
const int N = 5;

class C{
  public:
    int num, cnt;
    C(){}
    C(int _n, int _c){ num = _n; cnt = _c; }
};

bool compare_num(const C &a, const C &b){ return a.num < b.num; }
bool compare_cnt(const C &a, const C &b){ return a.cnt < b.cnt; }

string solve(int cards[N]){
  vector<C> c;
  set<int> s;
  REP(i, N){
    int cnt = 0;
    REP(j, N) if(cards[i] == cards[j]) ++cnt;
    if(s.find(cards[i]) == s.end()) c.push_back(C(cards[i], cnt));
    s.insert(cards[i]);
  }
  sort(c.begin(), c.end(), compare_cnt);
  reverse(c.begin(), c.end());
  if(c[0].cnt == 4) return "four card";
  if(c[0].cnt == 3 && c[1].cnt == 2) return "full house";
  sort(c.begin(), c.end(), compare_num);
  if(c.size() == 5 && ((c[0].num + 1 == c[1].num && c[1].num + 1 == c[2].num && c[2].num + 1 == c[3].num && c[3].num + 1 == c[4].num) || (c[0].num == 1 && c[1].num == 10 && c[2].num == 11 && c[3].num == 12 && c[4].num == 13))) return "straight";
  sort(c.begin(), c.end(), compare_cnt);
  reverse(c.begin(), c.end());
  if(c[0].cnt == 3) return "three card";
  if(c[0].cnt == 2 && c[1].cnt == 2) return "two pair";
  if(c[0].cnt == 2) return "one pair";
  return "null";
}

int main() {
  int cards[N];
  while(scanf("%d,%d,%d,%d,%d", &cards[0], &cards[1], &cards[2], &cards[3], &cards[4]) != EOF) cout <<solve(cards) <<endl;
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

int main(){
	int c;
	int cards[14], pairs[5];
	while( scanf("%d", &c )!=-1 ){
		memset( cards, 0, sizeof(cards) );
		memset( pairs, 0, sizeof(pairs) );
		cards[c]++;
		for( int i=0; i<4; i++ ){
			scanf(",%d",&c);
			cards[c]++;
		}
		for( int i=1; i<=13; i++ ){
			pairs[cards[i]]++;
		}
		if( pairs[4] ){
			cout << "four card" << endl;
		}else if( pairs[3] && pairs[2] ){
			cout << "full house" << endl;
		}else if( pairs[1] == 5 ){
			int i=1;
			for( ; i<=10; i++ ){
				if( cards[i] && cards[i+1] && cards[i+2] && cards[i+3] && cards[((i+3)%13)+1] ){
					cout << "straight" << endl;
					break;
				}
			}
			if( i>10 )
				cout << "null" << endl;
		}else if( pairs[3] ){
			cout << "three card" << endl;
		}else if( pairs[2] == 2 ){
			cout << "two pair" << endl;
		}else if( pairs[2] ){
			cout << "one pair" << endl;
		}else{
			cout << "null" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

int main(){
	int c;
	int cards[14], pairs[5];
	while( scanf("%d", &c ), c ){
		memset( cards, 0, sizeof(cards) );
		memset( pairs, 0, sizeof(pairs) );
		cards[c]++;
		for( int i=0; i<4; i++ ){
			scanf(",%d",&c);
			cards[c]++;
		}
		for( int i=1; i<=13; i++ ){
			pairs[cards[i]]++;
		}
		if( pairs[4] ){
			cout << "four card" << endl;
		}else if( pairs[3] && pairs[2] ){
			cout << "full house" << endl;
		}else if( pairs[1] == 5 ){
			int i=1;
			for( ; i<=10; i++ ){
				if( cards[i] && cards[i+1] && cards[i+2] && cards[i+3] && cards[((i+3)%13)+1] ){
					cout << "straight" << endl;
					break;
				}
			}
			if( i>10 )
				cout << "null" << endl;
		}else if( pairs[3] ){
			cout << "three card" << endl;
		}else if( pairs[2] == 2 ){
			cout << "two pair" << endl;
		}else if( pairs[2] ){
			cout << "one pair" << endl;
		}else{
			cout << "null" << endl;
		}
	}
	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


int main(){
	
	int a,b,c,d,e;
	while(scanf("%d,%d,%d,%d,%d",&a,&b,&c,&d,&e)!=EOF){
		typedef map<int,int> mii;
		
		mii m;
		m[a]++;
		m[b]++;
		m[c]++;
		m[d]++;
		m[e]++;
		
		typedef pair<int,int> pii;
		vector<pii> dat;
		mii::iterator it = m.begin();
		while(it!=m.end()){
			dat.push_back(pii(-it->second,it->first));
			it++;
		}
		sort(dat.begin(),dat.end());
		rep(i,dat.size())dat[i].first*=-1;
		
		
		bool flg[8]={false};
		flg[1]=true;
		if(dat[0].first==2){
			flg[2]=true;
		}
		if(dat[0].first==2 && dat[1].first==2){
			flg[3]=true;
		}
		if(dat[0].first==3){
			flg[4]=true;
		}
		
		if(dat.size()==5){
			int st = 0;
			if(dat[0].second==1 && dat[4].second==13)st=1;
			bool ok=true;
			reps(i,st,dat.size()-1){
				if(dat[i].second+1!=dat[i+1].second)ok=false;
			}
			flg[5]=ok;
		}
		
		if(dat[0].first==3 && dat[1].first==2){
			flg[6]=true;
		}
		if(dat[0].first==4){
			flg[7]=true;
		}
		
		//rep(i,dat.size())printf("%d-%d ",dat[i].first,dat[i].second);puts("");
		
		string yaku[8]={
			"null",
			"null",
			"one pair",
			"two pair",
			"three card",
			"straight",
			"full house",
			"four card"
		};
		
		for(int i=7;i>=1;i--){
			if(flg[i]){
				cout<<yaku[i]<<endl;
				break;
			}
		}
		
	}
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;

int n[5];

int main(){
	while(scanf("%d,%d,%d,%d,%d",&n[0],&n[1],&n[2],&n[3],&n[4])!=EOF){
		sort(n,n+5);
		if((n[0]==n[1]&&n[1]==n[2]&&n[2]==n[3])||(n[1]==n[2]&&n[2]==n[3]&&n[3]==n[4])) printf("four card\n");
		else if((n[0]==n[1]&&n[1]==n[2]&&n[3]==n[4])||(n[0]==n[1]&&n[2]==n[3]&&n[3]==n[4])) printf("full house\n");
		else if((n[4]==n[3]+1&&n[3]==n[2]+1&&n[2]==n[1]+1&&n[1]==n[0]+1)||(n[0]==10&&n[1]==11&&n[2]==12&&n[3]==13&&n[4]==1)) printf("straight\n");
		else if((n[0]==n[1]&&n[1]==n[2])||(n[1]==n[2]&&n[2]==n[3])||(n[2]==n[3]&&n[3]==n[4])) printf("three card\n");
		else if((n[0]==n[1]&&n[2]==n[3])||(n[0]==n[1]&&n[3]==n[4])||(n[1]==n[2]&&n[3]==n[4])) printf("two pair\n");
		else if(n[0]==n[1]||n[1]==n[2]||n[2]==n[3]||n[3]==n[4]) printf("one pair\n");
		else printf("null\n");
	}
	return 0;
}