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 <stdlib.h>

int cmp(const void *a, const void *b){
	return *(int*)a - *(int*)b;
}

int getpair(const int *cards, int n){
	int flag = 0;
	if(n>=2 && cards[0] == cards[1]){
		flag = 0x1;
		if(n>=3 && cards[1] == cards[2]){
			flag = 0x100;
			if(n>=4 && cards[2] == cards[3]){
				flag = 0x1000;
			}else if(n==5 && getpair(cards+3, 2) == 0x1){
				flag = 0x101;
			}
		}else if(n==5 && getpair(cards+2, 3) == 0x100){
			flag = 0x101;
		}else if((n>=4 && getpair(cards+2, 2)) ||
			(n==5 && getpair(cards+3, 2))){
			flag = 0x10;
		}
	}
	return flag;
}

int main(void){
	int cards[5];
	int flag = 0;
	for(int i=0;i<5;++i){
		cards[i] = 0;
	}

	while(scanf("%d,%d,%d,%d,%d",
		cards, cards+1, cards+2, cards+3, cards+4) != EOF){
		qsort(cards, 5, sizeof(int), cmp);
		if(cards[0] + 1 == cards[1] &&
			cards[1] + 1 == cards[2] &&
			cards[2] + 1 == cards[3] &&
			cards[3] + 1 == cards[4]){
			puts("straight");
			continue;
		}else 
		if(cards[0] == 1 && cards[1] == 10 && cards[2] == 11 &&
			cards[3] == 12 && cards[4] == 13){
			puts("straight");
			continue;
		}
		for(int i=0; i<4; ++i){
			flag = getpair(cards+i, 5-i);
			if(flag > 0){ break; }
		}

		switch(flag){
		case 0x1000:
			puts("four card");
			break;
		case 0x101:
			puts("full house");
			break;
		case 0x100:
			puts("three card");
			break;
		case 0x10:
			puts("two pair");
			break;
		case 0x1:
			puts("one pair");
			break;
		case 0x0:
			puts("null");
			break;
		default:
			break;
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


int main()
{
	while(true)
	{
		int v[5];
		char k;

		cin >> v[0];
		rep(i, 4)
			cin >> k >> v[i+1];


		vint n(13, 0);

		rep(i, 5)
			n[v[i]-1]++;

		rep(i, 13)	if(4 <= n[i])
		{
			cout << "four card" << endl;
			goto ng;
		}

		rep(i, 13) rep(j, 13) if(n[i] == 2 && n[j] == 3)
		{
			cout << "full house" << endl;
			goto ng;
		}

		rep(i, 10) if(n[i % 13] == 1 && n[(i+1) % 13] == 1 &&  n[(i+2) % 13] == 1 &&  n[(i+3) % 13] == 1 &&  n[(i+4) % 13] == 1)
		{
			cout << "straight" << endl;
			goto ng;
		}

		rep(i, 13) if(3 <= n[i])
		{
			cout << "three card" << endl;
			goto ng;
		}

		rep(i, 13) REP(j, 1, 13) if(n[i] == 2 && n[j] == 2)
		{
			cout << "two pair" << endl;
			goto ng;
		}

		rep(i, 13) if(n[i] == 2)
		{
			cout << "one pair" << endl;
			goto ng;
		}

		cout << "null" << endl;

ng:
		;
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <stdio.h>
#include <sstream>
#include <stdlib.h>
#include <math.h>
using namespace std;
 
#define rep(i,n) for(int i=0; i<n; i++)
#define FOR(i,s,n) for(int i=s; i<n; i++)
#define ALL(x) x.begin(), x.end()
#define pb push_back
#define foreach(it,con) for(auto it=con.begin();it!=con.end();it++)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;



string judge(int* nums){
	map<int,int> count;
	FOR(i,1,14){
		count[i] = 0;
	}
	rep(i,5){
		count[nums[i]]++;
	}
	
	bool is2 = false;
	bool is3 = false;
	int c=0;
	int mc=0;
	foreach(it,count){
		if(it->second>0){
			c++; 
			mc=max(mc,c);
		}else{
			c=0;
		}
		if(it->second==4){
			return "four card";
		}else if(it->second==3){
			is3 = true;
		}else if(it->second==2){
			if(is3){
				return "full house";
			}else if(is2){
				return "two pair";
			}else{
				is2 = true;
			}
		}
	}
	if(mc==5){
		return "straight";
	}
	if(is3){
		return "three card";
	}else if(is2){
		return "one pair";
	}
	return "null";
}



int main(){
	int nums[5];
	while(scanf("%d,%d,%d,%d,%d",&nums[0],&nums[1],&nums[2],&nums[3],&nums[4])+1){
		cout << judge(nums) << endl;
	}
	return 0;	
}

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

using namespace std;

int main(void){
    int cards[5];
    char dummy;
    while (cin>>cards[0]>>dummy>>cards[1]>>dummy>>cards[2]>>dummy>>cards[3]>>dummy>>cards[4])
    {
        int count=0,ans=0;
        sort(cards,cards+5);
        for (int i=0; i<4; i++)
        {
            if ( cards[i] == cards[i+1] )
            {
                count++;
                ans+=count;
            }
            else count=0;
        }
        
        if (ans==0)
        {
            int sum=0;
            for (int i=0; i<5; i++) sum+=cards[i];
            if(sum-cards[0]*5==10) puts("straight");
            else if(cards[0]==1 && cards[1]==10 && cards[2]==11 && cards[3]==12 && cards[4]==13) puts("straight");
            else puts("null");
        }
        
        else if (ans==1) puts("one pair");
        else if (ans==2) puts("two pair");
        else if (ans==3) puts("three card");
        else if (ans==4) puts("full house");
        else if (ans==6) puts("four card");
        
    }
    return 0;
}