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++: /* 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 cards"<<endl;
			break;
		case 6:
			cout<<"full house"<<endl;
			break;
		case 5:
			cout<<"straight"<<endl;
			break;
		case 4:
			cout<<"three cards"<<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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


int main()
{
	while(true)
	{
		int v[5];
		char k;
		
		if(cin.eof()) break;
		cin >> v[0];
		rep(i, 4)
			cin >> k >> v[i+1];


		vint n(13, 0);

		rep(i, 5)
			n[v[i]-1]++;

		rep(i, 13)	if(4 == n[i])
		{
			cout << "four card" << endl;
			goto ng;
		}

		rep(i, 13) rep(j, 13) if(n[i] == 2 && n[j] == 3)
		{
			cout << "full house" << endl;
			goto ng;
		}

		rep(i, 10) if(n[i % 13] == 1 && n[(i+1) % 13] == 1 &&  n[(i+2) % 13] == 1 &&  n[(i+3) % 13] == 1 &&  n[(i+4) % 13] == 1)
		{
			cout << "straight" << endl;
			goto ng;
		}

		rep(i, 13) if(3 <= n[i])
		{
			cout << "three card" << endl;
			goto ng;
		}

		rep(i, 13) REP(j, i+1, 13) if(n[i] == 2 && n[j] == 2)
		{
			cout << "two pair" << endl;
			goto ng;
		}

		rep(i, 13) if(n[i] == 2)
		{
			cout << "one pair" << endl;
			goto ng;
		}

		cout << "null" << endl;

ng:
		;
	}
}

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