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 <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main( void )
{
	string in;
	while ( cin >> in )
	{
		replace( in.begin(), in.end(), ',', ' ' );
		istringstream is( in );
		vector <int> hands(5);
		for ( int i = 0; i < 5; i++ )
		{
			is >> hands[i];
		}

		sort( hands.begin(), hands.end() );

		bool straight = true;
		for ( int i = 0 ; straight && i < 4; i++ )
		{
			if ( i == 0 && hands[0] == 1 && hands[1] == 10 )
				continue;
			if ( hands[i+1] - hands[i] != 1 )
			{
				straight = false;
			}
		}

		if ( straight )
		{
			cout << "straight" << endl;
		}
		else
		{
			vector <int> cnt( 14, 0 );
			for ( int i = 0; i < 5; i++ )
			{
				cnt[ hands[i] ] ++;
			}

			sort( cnt.rbegin(), cnt.rend() );

			if ( cnt[0] == 4 )
			{
				cout << "four card" << endl;
			}
			else if ( cnt[0] == 3 && cnt[1] == 2 )
			{
				cout << "full house" << endl;
			}
			else if ( cnt[0] == 3 )
			{
				cout << "three card" << endl;
			}
			else if ( cnt[0] == 2 && cnt[1] == 2 )
			{
				cout << "two pair" << endl;
			}
			else if ( cnt[0] == 2 )
			{
				cout << "one pair" << endl;
			}
			else
			{
				cout << "null" << endl;
			}

		}

	}
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int card[5];
int main()
{
  while(scanf("%d,%d,%d,%d,%d",&card[0],&card[1],&card[2],&card[3],&card[4]) !=EOF){
    sort(card,card+5);
    bool four,one,two,three,full,straight,flag;
    flag = false;
    one = two = three =four= full =straight = false;
    if(!flag){
      if(card[0]==card[1]&&card[0]==card[2]&&card[0]==card[3]||card[1]==card[2]&&card[1]==card[3]&&card[1]==card[4]){
	four = true;
	flag = true;
      }else if(card[0]==card[1]&&card[0]==card[2]&&(card[3]==card[4])||card[0]==card[1]&&card[2]==card[3]&&card[2]==card[4]){
	full = true;
	flag = true;
      }else if(card[0]==1&&card[1]==10&&card[2]==11&&card[3]==12&&card[4]==13||card[1]==card[0]+1&&card[2]==card[0]+2&&card[3]==card[0]+3&&card[4]==card[0]+4){
	straight = true;
	flag = true;
      }else if(card[0]==card[1]&&card[0]==card[2]||card[1]==card[2]&&card[1]==card[3]||card[2]==card[3]&&card[2]==card[4]){
	three = true;
	flag = true;
      }else if(card[0]==card[1]&&(card[2]==card[3]||card[3]==card[4])||card[1]==card[2]&&card[3]==card[4]){
	two = true;
	flag = true;
      }else if(card[0]==card[1]||card[1]==card[2]||card[2]==card[3]||card[3]==card[4]){
	one = true;
	flag = true;
      }
    }
    if(!flag)
      cout <<"null"<<endl;
    else if(four)
      cout <<"four card"<<endl;
    else if(full)
      cout <<"full house"<<endl;
    else if(straight)
      cout <<"straight"<<endl;
    else if(three)
      cout <<"three card"<<endl;
    else if(two)
      cout <<"two pair"<<endl;
    else if(one)
      cout <<"one pair"<<endl;
  }
  return 0;
}

C++: #include <string>
#include <iostream>
#include <map>
#include <cstdio>

using namespace std;

int main(){
	int hand[5];

	while(~scanf("%d", &hand[0])){
		for(int i = 1; i < 5; i++){
			scanf(",%d", &hand[i]);
		}
		int num[17] = {0};

		for(int i = 0; i < 5; i ++){
			if(hand[i] == 1){
				hand[i] += 13;
			}
			num[hand[i]]++;
		}

		int h = 0;
		string s[] = {"null", "one pair", "two pair", "three card", "straight", "full house", "four card"};
		int seq = 0;

		for(int i = 2; i < 17; i++){
			if(num[i] == 2){
				if(h == 3){
					h = 5;
				}else{
					h++;
				}
			}
			else if(num[i] == 3){
				if(h == 1){
					h = 5;
				}else{
					h = 3;
				}
			}
			else if(num[i] == 4){
				h = 6;
			}
			else if(num[i-2]&num[i-1]&num[i]&num[i+1]&num[i+2]){
				h = 4;
			}
		}

		cout << s[h] << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int a[5];
int main() {
    while(~scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3], &a[4])) {
        sort(a, a + 5);
        if((a[0] == a[1] || a[3] == a[4]) && a[1] == a[2] && a[2] == a[3]) printf("four card\n");
        else if((a[0] == a[1] && a[2] == a[3] && a[3] == a[4]) || (a[0] == a[1] && a[1] == a[2] && a[3] == a[4])) printf("full house\n");
        else if((a[0] + 1 == a[1] || (a[0] == 1 && a[1] == 10)) && a[1] + 1 == a[2] && a[2] + 1 == a[3] && a[3] + 1 == a[4]) printf("straight\n");
        else if(((a[0] == a[1] || a[2] == a[3]) && a[1] == a[2]) || (a[2] == a[3] && a[3] == a[4])) printf("three card\n");
        else {
            int p = 0; for(int i = 1; i < 5; i++) if(a[i - 1] == a[i]) p++;
            if(p == 2) printf("two pair\n");
            if(p == 1) printf("one pair\n");
            if(p == 0) printf("null\n");
        }
    }
    return 0;
}