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 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, count;
	
	for(i=0; i<5; i++){
		for(j=i; j<5; j++){
			if(a[i]>a[j]){
				m=a[i];
				a[i]=a[j];
				a[j]=m;
			}
		}
	}
	count=0;
	for(i=0; i<5; i++){
		if(a[i]!=a[0]+i){
			flag=0;
		}else{
			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++;
				m=i;
			}
		}
		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 && m!=i){
				count++;
			}
		}
		if(count==2){
			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);
		}
		output(result);
	}
	
	return 0;
}

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

using namespace std;

int main(void){
  int x[5],card[14],fg[5],i;
  vector<int>y;
  while(~scanf("%d,%d,%d,%d,%d"
	       ,&x[0],&x[1],&x[2],&x[3],&x[4])){
    
    memset(card,0,sizeof(card));
    memset(fg,0,sizeof(fg));


    for(i=0;i<5;i++)card[x[i]]++;

    for(i=1;i<14;i++){
      if(card[i]==2 && fg[0]==0)fg[0]=1;
      else if(card[i]==2 && fg[0]==1){
	fg[0]=0;
	cout <<"two pair" << endl;
	fg[2]=1;
	break;
      }
      else if(card[i]==3 && fg[0]!=1)fg[3]=1;
      else if(card[i]==3 && fg[0]==1){
	fg[0]=0;
	cout << "full house" << endl;
	fg[2]=1;
	break;
      }
      else if(card[i]==4){
	cout << "four card" << endl;
	fg[2]=1;
	break;
      }
    }
    if(fg[0]==1){
      cout << "one pair" << endl;
      fg[2]=1;
    }
    else if(fg[3]==1){
      cout << "three card" << endl;
      fg[2]=1;
    }
    
    for(i=0;i<5;i++)y.push_back(x[i]);
    sort(y.begin(),y.end());
 
    for(i=1;i<4;i++)if(y[i]+1!=y[i+1])fg[4]=1;

    if(!fg[4] && !fg[2]){
      cout << "straight" <<endl;
      fg[2]=1;
    }
    if(fg[2]==0)cout <<"null"<<endl;
    y.clear();
  }

  return 0;
}

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

using namespace std;

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

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

bool straight(int h[5]) {
	if (h[0] == 1 && h[1] != 2) {
		for (int i = 1; i < 5; i++)
			if (h[i] != i + 9)
				return false;
	}
	else {
		for (int i = 0; i < 4; i++)
			if (h[i] + 1 != h[i+1])
				return false;
	}
	return true;
}

bool threecard(int h[5]) {
	for (int i = 0; i < 3; i++)
		if (h[i] == h[i+1] && h[i] == h[i+2])
			return true;
	return false;
}

int pairs(int h[5]) {
	int ret = 0;
	for (int i = 0; i < 4; i++)
		if (h[i] == h[i+1]) {
			ret++;
			i++;
		}
	return ret;
}

int main() {
	int h[5];
	while (scanf("%d,%d,%d,%d,%d", &h[0], &h[1], &h[2], &h[3], &h[4]) != EOF) {
		sort(h, h + 5);
		for (int i = 0; i < 5; i++)
			printf("%d ", h[i]);
		printf("\n");
		if (fourcard(h)) printf("four card\n");
		else if (fullhouse(h)) printf("full house\n");
		else if (straight(h)) printf("straight\n");
		else if (threecard(h)) printf("three card\n");
		else {
			int n = pairs(h);
			switch (n) {
				case 1: printf("one pair\n"); break;
				case 2: printf("two pair\n"); break;
				default: printf("null\n"); break;
			}
		}
	}
	return 0;
}