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>

int main(void) {
  int i, j, k, c[5], t;
  while(scanf("%d", &c[0]) != EOF) {
    for(i = 1; i < 5; ++i) scanf(",%d", &c[i]);
    for(i = 0; i < 5; ++i) if(c[i] == 1) c[i] = 14;
    for(i = 0; i < 5; ++i) for(j = i + 1; j < 5; ++j) if(c[i] > c[j]) t = c[i], c[i] = c[j], c[j] = t;
    if((c[0] == c[1] && c[1] == c[2] && c[2] == c[3]) || (c[3] == c[4] && c[1] == c[2] && c[2] == c[3])) printf("four card\n");
    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])) printf("full house\n");
    else if(c[4] == c[3] + 1 && c[3] == c[2] + 1 && c[2] == c[1] + 1 && c[1] == c[0] + 1) printf("straight\n");
    else 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])) printf("three card\n");
    else if((c[0] == c[1] && c[2] == c[3]) || (c[0] == c[1] && c[3] == c[4]) || (c[1] == c[2] && c[3] == c[4])) printf("two pair\n");
    else if(c[0] == c[1] || c[1] == c[2] || c[2] == c[3] || c[3] == c[4]) printf("one pair\n");
    else printf("null\n");
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
 
 
int main()
{
    const int N = 5;
    while(1)
    {
        int hand[N];
        char x;
        int j;
        for(int i = 0; i < N; i++)
        {
            if(i)
                cin >> x;
            cin >> hand[i];
        }
        if(!cin)
            break;
 
        sort(hand, hand+N);
 
        if(hand[0] == hand[3] ||
            hand[1] == hand[4])
            cout << "four card" << endl;
        else if( (hand[0] == hand[1] && hand[2] == hand[4]) ||
                (hand[0] == hand[2] && hand[3] == hand[4]) )
            cout << "full house" << endl;
        else if( (hand[0] == 1 && hand[1] == 10 && hand[2] == 11 && hand[3] == 12 && hand[4] == 13) ||
            (hand[0]+1==hand[1] && hand[1]+1==hand[2] && hand[2]+1==hand[3] && hand[3]+1==hand[4]) )
            cout << "straight" << endl;
        else if( (hand[0] == hand[2] || hand[1] == hand[3] || hand[2] == hand[4]) )
            cout << "three card" << endl;
        else if( (hand[0]==hand[1] && hand[2]==hand[3]) ||
                (hand[0]==hand[1] && hand[3]==hand[4]) ||
                (hand[1]==hand[2] && hand[3]==hand[4]) )
            cout << "two pair" << endl;
        else if( hand[0]==hand[1] || hand[1]==hand[2] || hand[2]==hand[3] || hand[3]==hand[4] )
            cout << "one pair" << endl;
         else
         cout<<"null"<<endl;
       
    }
    return 0;
}

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

using namespace std;

bool isStraight(int xcard[5][2])
{
	if(xcard[0][0]==1&&xcard[1][0]==10&&xcard[2][0]==11&&xcard[3][0]==12&&xcard[4][0]==13)	return true;
	bool b=true;
	for(int i=0;i<4;i++)b&=(xcard[i+1][0]-xcard[i][0]==1);
	return b;
}

int main()
{
	int card[5];
	while(~scanf("%d,%d,%d,%d,%d",card,card+1,card+2,card+3,card+4)){
		int xcard[5][2];	// [0]:cardÌ, [1]:[0]Ì
		for(int i=0;i<5;i++)	xcard[i][0]=xcard[i][1]=0;

		int bucket[14]={0};
		for(int i=0;i<5;i++)	bucket[card[i]]++;
		for(int i=1,j=0;i<14;i++)
			if(bucket[i]>0)
				xcard[j][0]=i,xcard[j][1]=bucket[i],j++;

		if(xcard[0][1]==4 || xcard[1][1]==4){
			cout<<"four card"<<endl;
		}
		else if(xcard[0][1]+xcard[1][1]==5){
			cout<<"full house"<<endl;
		}
		else if(isStraight(xcard)){
			cout<<"straight"<<endl;
		}
		else if(xcard[0][1]==3 || xcard[1][1]==3 || xcard[2][1]==3){
			cout<<"three card"<<endl;
		}
		else{
			int numofpair=0;
			for(int i=0;i<5;i++)	numofpair+=(xcard[i][1]==2);
			switch(numofpair){
				case 2:	cout<<"two pair"<<endl;	break;
				case 1:	cout<<"one pair"<<endl;	break;
				case 0:	cout<<"null"<<endl;		break;
			}
		}
	}

	return 0;
}

C++: #include <stdio.h>

int bigger(int a, int b){
	if(a>=b){return a;}
	return b;
}

int one_pair(int a[]){
	int i, j;
	for(i=0; i<5; i++){
		for(j=0; j<5; j++){
			if(j!=i){
				if(a[i]==a[j]){
					return 1;
				}
			}
		}
	}
	return 0;
}

int two_pair(int a[]){
	int i, j, count=0;
	for(i=0; i<5; i++){
		for(j=0; j<5; j++){
			if(i!=j){
				if(a[i] == a[j]){
					count++;
				}
			}
		}
	}
	if(count == 4){
		return 1;
	}
	return 0;
}

int three_card(int a[]){
	int i, j, k;
	for(i=0; i<5; i++){
		for(j=0; j<5; j++){
			for(k=0; k<5; k++){
				if(i!=j && i!=k && j!=k){
					if(a[i]==a[j] && a[i]==a[k]){
						return 1;
					}
				}
			}
		}
	}
	return 0;
}

int four_card(int a[]){
	int i, j, count;
	for(i=0; i<13; i++){
		count=0;
		for(j=0; j<5; j++){
			if(a[j]==i+1){count++;}
		}
		if(count==4){return 1;}
	}
	return 0;
}

int straight(int a[]){
	int i, j, m, flag=0;
	
	for(i=0; i<5; i++){
		for(j=0; j<5; j++){
			if(a[i]<a[j]){
				m=a[i];
				a[i]=a[j];
				a[j]=m;
			}
		}
	}
	
	for(i=0; i<5; i++){
		if(i<4){
			if(a[i+1]-a[i]==1){
				flag++;
			}
		}
	}
	
	if(a[0]==1 && a[1]==10 && a[2]==11 && a[3]==12 && a[4]==13){
		flag++;
	}
	if(a[0]==1 && a[1]==2){
		flag*=0;
	}
	if(flag){
		return 1;
	}
	return 0;
}

int full_house(int a[]){
	int i, j, k, m, count;
	for(i=0; i<13; i++){
		count=0;
		for(j=0; j<5; j++){
			if(a[j]==i+1){
				count++;
				a[j]=-1;
			}
		}
		if(count==3){
			break;
		}
	}
	if(count!=3){return 0;}
	
	for(i=0; i<13; i++){
		count=0;
		for(j=0; j<5; j++){
			if(a[j]=i+1){
				count++;
				a[j]=-1;
				return 1;
			}
		}
	}
	return 0;
}

int output(int n){
	switch(n){
		case 1:
			printf("null\n");
			break;
		case 2:
			printf("one pair\n");
			break;
		case 3:
			printf("two pair\n");
			break;
		case 4:
			printf("three card\n");
			break;
		case 5:
			printf("straight\n");
			break;
		case 6:
			printf("full house\n");
			break;
		case 7:
			printf("four card\n");
			break;
		default:
			return 0;
	}
	return 1;
}

int main (void){
	int cards[5], result;
	while(scanf("%d,%d,%d,%d,%d", &cards[0], &cards[1], &cards[2], &cards[3], &cards[4])!=EOF){
		result=1;
		if(one_pair(cards)){
			result=bigger(result, 2);
		}
		if(two_pair(cards)){
			result=bigger(result, 3);
		}
		if(three_card(cards)){
			result=bigger(result, 4);
		}
		if(straight(cards)){
			result=bigger(result, 5);
		}
		if(full_house(cards)){
			result=bigger(result, 6);
		}
		if(four_card(cards)){
			result=bigger(result, 7);
		}
		printf("%d\n", result);
		output(result);
	}
	
	return 0;
}