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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

typedef long long ll;
using namespace std;

bool is_1pair(int* cards){
	sort(cards,cards+5);
	map<int,int> freq;
	for(int i=0;i<5;i++){
		freq[cards[i]]++;
	}
	
	int count = 0;
	for(map<int,int>::iterator it = freq.begin(); it != freq.end(); it++){
		if(it->second == 2){
			count++;
		}
		if(it->second == 3){
			return false;
		}
	}

	return count == 1;
}

bool is_2pair(int* cards){
	sort(cards,cards+5);
	map<int,int> freq;
	for(int i=0;i<5;i++){
		freq[cards[i]]++;
	}
	
	int count = 0;
	for(map<int,int>::iterator it = freq.begin(); it != freq.end(); it++){
		if(it->second == 2){
			count++;
		}
	}

	return count == 2;
}

bool is_3card(int* cards){
	sort(cards,cards+5);
	map<int,int> freq;
	for(int i=0;i<5;i++){
		freq[cards[i]]++;
	}
	
	int count = 0;
	for(map<int,int>::iterator it = freq.begin(); it != freq.end(); it++){
		if(it->second == 3){
			count++;
		}
		if(it->second == 2){
			return false;
		}
	}

	return count == 1;
}

bool is_straight(int* cards){
	sort(cards,cards+5);
	map<int,int> freq;
	for(int i=0;i<5;i++){
		freq[cards[i]]++;
	}
	
	int count = 0;
	for(map<int,int>::iterator it = freq.begin(); it != freq.end(); it++){
		if(it->second > 1){
			return false;
		}
	}

	if(freq[1]==1){
		int ans[][5] = {{1,2,3,4,5},{1,10,11,12,13}};

		bool isok1 = true;
		for(int i=0;i<5;i++){
			if(cards[i] != ans[0][i]) isok1 = false;
		}

		bool isok2 = true;
		for(int i=0;i<5;i++){
			if(cards[i] != ans[1][i]) isok2 = false;
		}

		return (isok1 || isok2);
	}

	else{
		for(int i=0;i+1<5;i++){
			if(cards[i+1] - cards[i] != 1) return false;
		}
	}

	return true;
}

bool is_fullhouse(int* cards){
	sort(cards,cards+5);
	map<int,int> freq;
	for(int i=0;i<5;i++){
		freq[cards[i]]++;
	}
	
	int count = 0;
	bool isok1=false,isok2=false;
	for(map<int,int>::iterator it = freq.begin(); it != freq.end(); it++){
		if(it->second == 3){
			isok1 = true;
		}
		else if(it->second == 2){
			isok2 = true;
		}
	}

	return isok1 && isok2;
}

bool is_4card(int* cards){
	sort(cards,cards+5);
	map<int,int> freq;
	for(int i=0;i<5;i++){
		freq[cards[i]]++;
	}
	int count = 0;
	for(map<int,int>::iterator it = freq.begin(); it != freq.end(); it++){
		if(it->second == 4){
			return true;
		}
	}

	return false;
}
int main()
{
	int cards[5];
	while(~scanf("%d,%d,%d,%d,%d",cards,cards+1,cards+2,cards+3,cards+4)){
		if(is_1pair(cards)) cout << "one pair" << endl;
		else if(is_2pair(cards)) cout << "two pair" << endl;
		else if(is_3card(cards)) cout << "three card" << endl;
		else if(is_straight(cards)) cout << "straight" << endl;
		else if(is_fullhouse(cards)) cout << "full house" << endl;
		else if(is_4card(cards)) cout << "four card" << endl;
		else cout << "null" << endl;

	}
}

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

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <map>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	int card[5];
	while(1){
		rep(i, 5){
			if(scanf("%d,", &card[i]) == EOF)
				return 0;
		}
		
		sort(card, card+5);

		int cnt[4] = {0};
		rep(i, 5){
			cnt[0]++;
			int j=1;
			for(j=1; i+j<5 && card[i+j]==card[i]; ++j){
				cnt[j-1]--;
				cnt[j]++;
			}
			i += j-1;
		}
		if(cnt[3])
			puts("four card");
		else if(cnt[2] && cnt[1])
			puts("full house");
		else if(cnt[0]==5 && (card[4]-card[0]==4 || (card[0]==1 && card[1]==10)))
			puts("straight");
		else if(cnt[2])
			puts("three card");
		else if(cnt[1] == 2)
			puts("two pair");
		else if(cnt[1])
			puts("one pair");
		else
			puts("null");
	}
}

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

using namespace std;

int main()
{
    int cs[5];
    while( scanf( "%d,%d,%d,%d,%d", &cs[0], &cs[1], &cs[2], &cs[3], &cs[4] ) != -1 ) {
        sort( cs, cs + 5 );

        vector<int> uc( 5 );
        unique_copy( cs, cs+5, uc.begin() );

        int p[5] = {};
        for( auto const& c : uc ) {
            ++p[count( cs, cs + 5, c )];
        }
        
        bool const is_straight = [&]{
            bool const b = [&](){
                for( int i=1; i<5; ++i ) {
                    if ( cs[i-1] + 1 != cs[i] )
                        return false;
                }
                return true;
            }();

            return b
                   || ( cs[0] == 10 && cs[1] == 11 && cs[2] == 12 && cs[3] == 13 && cs[4] == 1 )
                   || ( cs[0] == 1 && cs[1] == 10 && cs[2] == 11 && cs[3] == 12 && cs[4] == 13 );
        }();

        
        cout <<
            ( ( p[4] == 1 )
              ? "four card"
              : ( p[3] == 1 && p[2] == 1 )
              ? "full house"
              : ( is_straight )
              ? "straight"
              : ( p[3] == 1 )
              ? "three card"
              : ( p[2] == 2 )
              ? "two pair"
              : ( p[2] == 1 )
              ? "one pair"
              : "null" )
            << endl;
    }
}