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 <bits/stdc++.h>
using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

int main() {
  int c[5];

  while(scanf("%d,%d,%d,%d,%d", &c[0], &c[1], &c[2], &c[3], &c[4]) != EOF) {
    int n[13] = {};
    REP(i, 5) n[c[i]-1]++;

    int first = 0, second = 0, straight = 0;
    REP(i, 13) {
      if(n[i] > 0 && n[(i+1)%13] > 0) 
	straight++;
      if(first < n[i]) {
	second = first;
	first = n[i];
      } else if(second < n[i]) {
	second = n[i];
      }
    }

    if(first == 4) cout << "four card" << endl;
    else if(first == 3) {
      if(second == 2) cout << "full house" << endl;
      else cout << "three card" << endl;
    }
    else if(straight == 4 ) {
      if(n[12] > 0 && n[1] > 0 || n[2] > 0 || n[3] > 0) cout << "null" << endl;
      else cout << "straight" << endl;
    }
    else if(first == 2 && second == 2) cout << "two pair" << endl;
    else if(first == 2) cout << "one pair" << endl;
    else cout << "null" << endl;
  }
}

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 <algorithm>

using namespace std;

int main(void){

  int card[5];
  char ten;

  while( cin >> card[0] ){
    cin >> ten >> card[1] >> ten >> card[2] >> ten >> card[3] >> ten >> card[4];

    sort( card , card + 5 );

    if( card[4] == card[1] || card[3] == card[0] ){// four card
      cout << "four card" << endl;
      goto end;
    }

    if( (card[0] == card[2] && card[3] == card[4]) || (card[0] == card[1] && card[2] == card[4] ) ){
      cout << "hull house" << endl;
      goto end;
    }

    int cnt;
    int r;
    cnt = 0;
    r = card[0];
    for( int i = 1 ; i < 5 ; i++ ){// straight
      if( r + 1 == card[i] ){
	cnt++;
	r = card[i];
      }
      else r = card[i];
    }
    if( cnt == 4 ){
      cout << "straight" << endl;
      goto end;
    }
    else if( card[0] == 1  && card[1] == 10 && card[2] == 11 && card[3] == 12 && card[4] == 13 ){
      cout << "straight" << endl;
      goto end;
    }

    if( card[0] == card[2] || card[1] == card[3] || card[2] == card[4] ){// three card
      cout << "three card" << endl;
      goto end;
    }

    if( card[0] == card[1] && card[2] == card[3] ){// two pair
      cout << "two pair" << endl;
      goto end;
    }
    else if( card[0] == card[1] && card[3] == card[4] ){
      cout << "two pair" << endl;
      goto end;
    }
    else if( card[1] == card[2] && card[3] == card[4] ){
      cout << "two pair" << endl;
      goto end;
    }

    for( int i = 0 ; i < 4 ; i++ ){// two card
      if( card[i] == card[i+1] ){
	cout << "one pair" << endl;
	goto end;
      }
     }

      cout << "null" << endl;

  end:;
  }
  return 0;
}