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<stdio.h>
using namespace std;

int main() {
	int c[5];
	while (scanf("%d,%d,%d,%d,%d", &c[0], &c[1], &c[2], &c[3], &c[4]) != EOF) {
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j<4; j++) {
				if (c[j] > c[j + 1]) {
					int tmp = c[j];
					c[j] = c[j + 1];
					c[j + 1] = tmp;
				}
			}
		}
		if ((c[0]==c[1]&&c[1]==c[2]&&c[2]==c[3])||(c[1]==c[2]&&c[2]==c[3]&&c[3]==c[4]))cout << "four cards" << endl;
		else if ((c[0]==c[1]&&c[1]==c[2]&&c[3]==c[4])||(c[0]==c[1]&&c[2]==c[3]&&c[3]==c[4]))cout << "full house" << endl;
		else if ((c[0]==1&&c[1]==10&&c[2]==11&&c[3]==12&&c[4]==13)||(c[0]+1==c[1]&&c[0]+2==c[2]&&c[0]+3==c[3]&&c[0]+4==c[4]))cout << "straight" << endl;
		else if ((c[0]==c[1]&&c[1]==c[2])||(c[1]==c[2]&&c[2]==c[3])||(c[2]==c[3]&&c[3]==c[4]))cout << "three cards" << endl;
		else if ((c[0]==c[1]&&c[2]==c[3])||(c[1]==c[2]&&c[3]==c[4])||(c[0]==c[1]&&c[3]==c[4]))cout << "two pair" << endl;
		else if ((c[0] == c[1]) || (c[1] == c[2]) || (c[2] == c[3]) || (c[3] == c[4]))cout << "one pair" << endl;
		else cout << "null" << endl;
	}
}

C++: /* AOJ 0038*/

#include<iostream>
#include<queue>

using namespace std;

void Swap(int *a,int *b){
	int tmp = *a;
	*a = *b;
	*b = tmp;
}

void BabbleSort(int *data,int n){

	int i,j;
	for(i=0;i<n-1;i++){
		for(j=n-1;j>i;j--){
			if(data[j] <= data[j-1]){
				Swap(&data[j],&data[j-1]);
			}
		}
	}

}

//onePair or threeCards or fourCards
int isSameCard(int *data){
	
	int tmp[13];

	for(int i=0;i<13;i++){
		tmp[i] = 0;
	}

	for(int i=0;i<5;i++){
		tmp[data[i]-1]++;
	}

	BabbleSort(tmp,13);

	if(tmp[12]==3 && tmp[11] == 2){
		return 6;//フルハウス
	}
	else if(tmp[12] == 4){
		return 7;//フォーカード
	}
	else if(tmp[12] == 3){
		return 4;
	}
	else if(tmp[12] == 2 && tmp[11] == 2){
		return 3;
	}
	else if(tmp[12] == 2){
		return 2;
	}
	else{
		return 1;
	}
}

int isStraight(int *data){
	
	int tmp[13];

	for(int i=0;i<13;i++){
		tmp[i] = 0;
	}

	for(int i=0;i<5;i++){
		tmp[data[i]-1]++;
	}

	if(tmp[9] == 1 && tmp[10] == 1 && tmp[11] == 1 && tmp[12]==1 && tmp[0]==1){
		return 5;
	}
	else{
		for(int i=0;i<=13-5;i++){
			if(tmp[i]==1&&tmp[i+1]==1&&tmp[i+2]==1&&tmp[i+3]==1&&tmp[i+4]==1){
				return 5;
			}
		}
	}

	return 1;
}

int main(){

	int data[5];
	char tmp;

	queue<int> ans;

	while(cin>>data[0]){
		if(data[0]==0){
			break;
		}
		cin>>tmp;
		cin>>data[1];
		cin>>tmp;
		cin>>data[2];
		cin>>tmp;
		cin>>data[3];
		cin>>tmp;
		cin>>data[4];

		BabbleSort(data,5);

		if(isSameCard(data)>=2){
			ans.push(isSameCard(data));
		}
		else{
			ans.push(isStraight(data));
		}

	}

	int size=ans.size();

	for(int i=0;i<size;i++){
		switch(ans.front()){
		case 7:
			cout<<"four card"<<endl;
			break;
		case 6:
			cout<<"full house"<<endl;
			break;
		case 5:
			cout<<"straight"<<endl;
			break;
		case 4:
			cout<<"three card"<<endl;
			break;
		case 3:
			cout<<"two pair"<<endl;
			break;
		case 2:
			cout<<"one pair"<<endl;
			break;
		case 1:
			cout<<"null"<<endl;
			break;
		}
		ans.pop();
	}

	return 0;
}

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

using namespace std;

int h[5];

bool four_card() {
    if ( (h[0] == h[1] && h[1] == h[2] && h[2] == h[3]) ||
         (h[1] == h[2] && h[2] == h[3] && h[3] == h[4]) )
        return true;
    else 
        return false;
}

bool full_house() {
    if ( ((h[0] == h[1] && h[1] == h[2]) && (h[3] == h[4])) || ((h[0] == h[1]) && (h[2] == h[3] && h[3] == h[4])) ) 
        return true;
     else
        return false;
}

bool three_card() {
    if ( (h[0] == h[1] && h[1] == h[2]) ||
         (h[1] == h[2] && h[2] == h[3]) ||
         (h[2] == h[3] && h[3] == h[4]) ) 
        return true;
    else 
        return false;
}

bool straight() {
    if ( (h[0] + 1 == h[1]) &&
         (h[1] + 1 == h[2]) &&
         (h[2] + 1 == h[3]) &&
         (h[3] + 1 == h[4]) )
        return true;
    else {
        if (h[0] == 1 && h[1] == 10 
                      && h[2] == 11
                      && h[3] == 12
                      && h[4] == 13)
            return true;
        return false;
    }
}

bool two_pair() {
    if ( (h[0] == h[1] && h[2] == h[3]) ||
         (h[0] == h[1] && h[3] == h[4]) ||
         (h[1] == h[2] && h[3] == h[4]) )
        return true;
    else 
        return false;
}
        
bool one_pair() {
    if (h[0] == h[1] || h[1] == h[2] || h[2] == h[3] || h[3] == h[4]) 
        return true;
    else 
        return false;
}

void find_hand() {
    sort(h, h+5);
    if (four_card()) {
        cout << "four card" << endl;
    } else if (full_house()) {
        cout << "full house" << endl;
    } else if (straight()) {
        cout << "straight" << endl;
    } else if (three_card()) {
        cout << "three card" << endl;
    } else if (two_pair()) {
        cout << "two pair" << endl;
    } else if (one_pair()) {
        cout << "one pair" << endl;
    } else {
        cout << "null" << endl;
    }
}

int main() {
    char dm;
    while (cin >> h[0] >> dm 
               >> h[1] >> dm
               >> h[2] >> dm
               >> h[3] >> dm
               >> h[4] ) {
        find_hand();
    }
    return 0;
}

C++: #include<cstdio>

using namespace std;

void bubble_ask(int x[]);

int card[5];
int main(void){
	int i,cnt=0,st=0,pair=0;

	while(scanf("%d,%d,%d,%d,%d",&card[0],&card[1],&card[2],&card[3],&card[4])!=EOF){
		//昇順にソート
		bubble_ask(card);
		
		for(i=0;i<4;i++){
			if(card[i]+1==card[i+1])	st++;
			if(card[i]==1 && card[4]==13 && card[1]!=2)	st++;
			if(i!=3){
				if(card[i]==card[i+1] && card[i+1]==card[i+2] && cnt!=4)	cnt=3;
			}
			if(i!=3 && i!=2){
				if(card[i]==card[i+1] && card[i+1]==card[i+2] && card[i+2]==card[i+3])	cnt=4;
			}
			if(card[i]==card[i+1]) pair++;
		}

		//four card
		if(cnt==4)	printf("four card\n");
		//full house
		else if(cnt==3 && pair==3)	printf("full house\n");
		//straight
		else if(st==4)	printf("straight\n");
		//three card
		else if(cnt==3)	printf("three card\n");
		//two pair
		else if(pair==2)	printf("two pair\n");
		//one pair
		else if(pair==1)	printf("one pair\n");
		//null
		else	printf("null\n");

		cnt=st=pair=0;
	}

	return 0;
}

void bubble_ask(int card[]){
	int i,j,data;
	for(i=0;i<4;i++){
		for(j=i+1;j<5;j++){
			if(card[i] > card[j]){
				data=card[i];
				card[i]=card[j];
				card[j]=data;
			}
		}
	}
}