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[0] > 0 && n[1] > 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 <iostream>
#include <algorithm>
using namespace std;
bool isStraight(int* a)
{
	if(a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13) return true;
	for(int i=1;i<5;i++) if(a[i]!=a[i-1]+1) return false;
	return true;
}
int main()
{
	int a[5]; char ch;
	while(cin >> a[0] >> ch >> a[1] >> ch >> a[2] >> ch >> a[3] >> ch >> a[4])
	{
		int sum=1; int pair=0;
		sort(a,a+5);
		for(int i=1;i<5;i++)
		{
			int tmp=1;
			while(i<5 && a[i-1]==a[i]) {tmp++; i++;}
			sum=max(tmp,sum);
		}
		bool flag=true;
		for(int i=1;i<5;i++)
		{
			if(flag && a[i-1]==a[i]) {pair++; flag=false;}
			else flag=true;
		}
		if(sum==4) cout << "four card" << endl;
		else if(sum==3 && pair==2) cout << "full house" << endl;
		else if(isStraight(a)) cout << "straight" << endl;
		else if(sum==3) cout << "three card" << endl;
		else if(pair==2) cout<< "two pair" << endl;
		else if(pair==1) cout << "one pair" << endl;
		else cout << "null" << endl;
	}
}

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

bool isFourCard(int cards[5]){
	bool res = true;

	for (int i = 1; i < 4; i++){
		if (cards[i] != cards[i + 1])res = false;
	}

	if (res)return true;

	res = true;

	for (int i = 0; i < 3; i++){
		if (cards[i] != cards[i + 1])res = false;
	}

	return res;
}

bool isFullHouse(int cards[5]){
	if (cards[0] == cards[1] && cards[2] == cards[3] && cards[3] == cards[4])return true;
	if (cards[0] == cards[1] && cards[1] == cards[2] && cards[3] == cards[4])return true;

	return false;
}

bool isStraight(int cards[5]){
	bool res = true;

	for (int i = 0; i < 4; i++){
		if (cards[i] + 1 != cards[i + 1])res = false;
	}

	if (cards[0] == 1 && cards[1] == 10 && cards[2] == 11 && cards[3] == 12 && cards[4] == 13)res = true;

	return res;
}


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

	return false;
}

int Pair(int cards[5]){
	int cnt = 0;

	for (int i = 0; i < 4; i++){
		if (cards[i] == cards[i + 1])cnt++;
	}

	return cnt;
}

int main(){

	int cards[5];

	while (std::cin >> cards[0]){
		
		for (int i = 1; i < 5; i++){
			char a;
			std::cin >> a >> cards[i];
		}

		std::sort(cards, cards + 5);

		if (isFourCard(cards)){
			std::cout << "four card" << std::endl;
			continue;
		}

		if (isFullHouse(cards)){
			std::cout << "full house" << std::endl;
			continue;
		}

		if (isStraight(cards)){
			std::cout << "straight" << std::endl;
			continue;
		}

		if (isThreeCard(cards)){
			std::cout << "three card" << std::endl;
			continue;
		}

		if (Pair(cards) == 2){
			std::cout << "two pair" << std::endl;
			continue;
		}

		if (Pair(cards) == 1){
			std::cout << "one pair" << std::endl;
			continue;
		}

		if (Pair(cards) == 0){
			std::cout << "null" << std::endl;
			continue;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;

string paircard(int card[]){
		int num[13] = {0};
		for(int i=0;i<5;i++) num[card[i]-1]++;
		sort(num,num+13,greater<int>());
			if(num[0] == 4 && num[1] ==1) return "four card";
			if(num[0] == 3 && num[1] ==2) return "full house";
			if(num[0] == 3 && num[1] ==1) return "three card";
			if(num[0] == 2 && num[1] ==2) return "two pair";
			if(num[0] == 2 && num[1] ==1) return "one pair";
		return "null";
}

bool straight(int card[]){
	if(card[0] == 1 && card[1]==10 && card[2] == 11 && card[3] == 12 && card[4] == 13)
	return true;
	int ans = 1;
	for(int i=0;i+1<5;i++) if(card[0]+i+1 == card[i+1]) ans++;
	if(ans==5) return true;

	return false;
}

string poker(int card[]){
	if(straight(card)){return "straight";}
 	return paircard(card);
}

int main(){
	char k; int card[5];
	while(1){
		cin>>card[0]>>k>>card[1]>>k>>card[2]>>k>>card[3]>>k>>card[4];
				if(cin.eof())break;
		sort(card,card+5);
		cout << poker(card) << endl;
	}
}