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>

#define ACE 14
int is4card(int cnt[]);
int isFullHouse(int cnt[]);
int isStraight(int cnt[]);
int is3card(int cnt[]);
int is2pair(int cnt[]);
int is1pair(int cnt[]);

int main(void){
    int c[5];
    int count[ACE+1];
    
    while (scanf("%d,%d,%d,%d,%d", c+0, c+1, c+2, c+3, c+4) != EOF){
        for (int i=2; i<=ACE; i++) count[i]=0;
        for (int i=0; i<5; i++){
            if (c[i]==1) c[i]=ACE;
            count[c[i]]++;
        }
//        for (int i=2; i<=ACE; i++) printf("%d ",count[i]);
//        printf("\n");
        
        if (is4card(count)) printf("four card\n");
        else if (isFullHouse(count)) printf("full house\n");
        else if (isStraight(count)) printf("straight\n");
        else if (is3card(count)) printf("three card\n");
        else if (is2pair(count)) printf("two pair\n");
        else if (is1pair(count)) printf("one pair\n");
        else printf("null\n");
    }
    return 0;
}

int is4card(int cnt[]){
    for (int i=2; i<=ACE; i++){
        if (cnt[i] == 4) return 1;
    }
    return 0;
}

int isFullHouse(int cnt[]){
    return is3card(cnt) && is1pair(cnt);
}

int isStraight(int cnt[]){
    int len=0;
    
    for (int i=2; i<=ACE; i++){
        if (cnt[i]==0) len=0;
        else {
            len++;
            if (len==5) return 1;
        }
    }
    return 0;
}

int is3card(int cnt[]){
    for (int i=2; i<=ACE; i++){
        if (cnt[i] == 3) return 1;
    }
    return 0;
}

int is2pair(int cnt[]){
    int i,j;
    // find the first pair
    for (i=2; i<=ACE; i++){
        if (cnt[i] == 2) break;
    }
    if (i>ACE) return 0;
    // find second pair
    for (j=2; j<=ACE; j++){
        if (i==j) continue;
        if (cnt[j] == 2) return 1;
    }
    return 0;
}

int is1pair(int cnt[]){
    for (int i=2; i<=ACE; i++){
        if (cnt[i] == 2) return 1;
    }
    return 0;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
/* null
 * one pair
 * two pair
 * three card
 * straight
 * full house
 * four card
 * */
int main() {
	vector<int> cards(5);
	while (scanf("%d%*c%d%*c%d%*c%d%*c%d",&cards[0],&cards[1],&cards[2],
				&cards[3],&cards[4])) {
		vector<int> cnt(13, 0);
		for (int i=0; i<5; i++) cnt[cards[i]-1]++;
		int two = 0, three = 0, four = 0;
		for (int i=0; i<13; i++) {
			if (cnt[i] == 2) two++;
			if (cnt[i] == 3) three++;
			if (cnt[i] == 4) four++;
		}
		if (four == 1) {
			printf("four card\n");
			continue;
		} else if (two == 1 && three == 1) {
			printf("full house\n");
			continue;
		} else if (three == 1) {
			printf("three card\n");
			continue;
		} else if (two == 2) {
			printf("two pair\n");
			continue;
		} else if (two == 1) {
			printf("one pair\n");
			continue;
		}
		int c = 0;
		bool flag = false;
		for (int i=0; i<10; i++) {
			if (cnt[i] == 1) {
				c++;
				for (int j=1; j<5; j++) {
					int p = j + i;
					if (p == 13) p = 0;
//					printf("%d\n", p);
					if (cnt[p] == 1) c++;
				}
				if (c == 5) {
					flag = true;
					break;
				}
				c = 0;
			}
		}
		if (flag) {
			printf("straight\n");
		} else {
			printf("null\n");
		}
	}	
}

C++: #include <iostream>
#include <algorithm>
int main()
{
	int cs[5], i, j, t, r, fl, fl2;
	char c, *s[8] = {"null", "one pair", "two pair", "three card", "straight", "full house", "four card"};
	while (std::cin >> cs[0] >> c >> cs[1] >> c >> cs[2] >> c >> cs[3] >> c >> cs[4])
	{
		r = 1;
		std::sort(cs, cs+5);
		int n[13] = {0};
		for (i = 0; i < 5; i++)
			n[cs[i]-1]++;
		for (i = t = 0; i < 13; i++)
			if (n[i] == 2)	t++;
		if (t == 1)	r = 2;
		if (t == 2)	r = 3;
		for (i = fl = 0; i < 13 && !fl; i++)
			if (n[i] == 3)		r = 4, fl = 1;
			else if (n[i] == 4)	r = 7, fl = 1;
		for (i = fl = 0; i < 9 && !fl; i++)
		{
			for (j = 0, fl2 = 1; j < 5 && fl2; j++)
				if (n[i+j] != 1)	fl2 = 0;
			if (fl2)	r = 5;
		}
		if (!fl)
		{
			for (i = 9, fl = 0; i < 13 && !fl; i++)
				if (n[i] != 1)	fl = 1;
			if (!fl && n[0])	r = 5;
		}
		for (i = fl = fl2 = 0; i < 13; i++)
		{
			if (n[i] == 2)	fl = 1;
			if (n[i] == 3)	fl2 = 1;
		}
		if (fl && fl2)	r = 6;
		std::cout << s[r-1] << std::endl;
	}
}

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

int straight(int card[])
{
	for(int i=1; i<9; i++){
		if(((card[0]==i)&&(card[1]==i+1)&&(card[2]==i+2)&&(card[3]==i+3)&&(card[4]==i+4)) || 
			(card[0]==1&&card[1]==10&&card[2]==11&&card[3]==12&&card[4]==13))
			return 1;
	}
	return 0;
}

int main(){
	int c[5], n;
	char k;

	while(1){
		cin>>c[0]>>k>>c[1]>>k>>c[2]>>k>>c[3]>>k>>c[4];
		if(cin.eof())break;
		n=0;
		sort(c, c+5);

		for(int i=0; i<4; i++){
			for(int j=i+1; j<5; j++){
				if(c[i]==c[j])
					n++;
			}
		}
		switch(n){
			case 1:
				cout<<"one pair\n";
				break;
			case 2:
				cout<<"two pair\n";
				break;
			case 3:
				cout<<"three card\n";
				break;
			case 4:
				cout<<"full house\n";
				break;
			case 6:
				cout<<"four card\n";
				break;
			case 10:
				cout<<"four card\n";
				break;
			default:
				if(straight(c))
					cout<<"straight\n";
				else
					cout<<"null\n";
				break;
		}
	}

	return 0;
}

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

using namespace std;
int main(void)
{
	int card[5];
	char kari;
	while(1)
	{
		for(int i = 0;i < 5;i++)
		{
			if(scanf("%d",&card[i])== EOF) goto kitune;
			scanf("%c",&kari);
		}
		int cnt = 0,check[15] = {0};
		sort(card,card+5);
		for(int i = 0;i<5;i++)
		{
			check[card[i]]++;
			if(card[i] == 1) check[14] = 1;
		}
		for(int i = 0;i<=14;i++)
		{
			if(check[i] == 1)
			{
				if(check[i+1] == 1) 
				{
					cnt++;
					if(cnt == 4) break;
				}
				else cnt = 0;
			}
		}

		int pair = 0;
		int three = 0;
		int four = 0;
		int st = 0;
		if(cnt == 4)
		{
			printf("straight\n");
			st = 1;
		}
		else
		{
			for(int i = 0;i < 13;i++)
			{
				if(check[i] == 2) pair++;
				if(check[i] == 3) three++;
				if(check[i] >= 4) four++;
			}
		}
		if(pair >= 1)
		{
			if(three == 1) printf("full house\n");
			else if(pair == 2) printf("two pair\n");
			else printf("one pair\n");
		}
		else if(three >= 1)
		{
			if(pair == 1) printf("full house\n");
			else if(three == 2) printf("hull house\n");
			else printf("three card\n");
		}
		else if(four >= 1) printf("four card\n");
		else if(st != 1) printf("null\n");
	}
	kitune:
	return 0;
}