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 <cstdio>
#include <functional>
#include <algorithm>

using namespace std;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int d[ 5 ];
  int i;

  while ( scanf ( " %d,%d,%d,%d,%d"
                , d, d + 1, d + 2, d + 3, d + 4 ) == 5 )
  {
    int c[ 13 ] = { 0 };

    sort ( d, d + 5 );
    for ( i = 0; i < 5; ++i )
    {
      ++c[ d[ i ] - 1 ];
    }
    sort ( c, c + 13, greater< int > ( ) );

    if ( c[ 0 ] == 4 )
    {
      puts ( "four card" );
    }
    else if ( c[ 0 ] == 3 && c[ 1 ] == 2 )
    {
      puts ( "full house" );
    }
    else if ( ( d[ 0 ] == d[ 1 ] - 1
             && d[ 0 ] == d[ 2 ] - 2
             && d[ 0 ] == d[ 3 ] - 3
             && d[ 0 ] == d[ 4 ] - 4 )
           || ( d[ 0 ] == 1
             && d[ 1 ] == 10
             && d[ 2 ] == 11
             && d[ 3 ] == 12
             && d[ 4 ] == 13 ) )
    {
      puts ( "straight" );
    }
    else if ( c[ 0 ] == 3 )
    {
      puts ( "three card" );
    }
    else if ( c[ 0 ] == 2 && c[ 1 ] == 2 )
    {
      puts ( "two pair" );
    }
    else if ( c[ 0 ] == 2 )
    {
      puts ( "one pair" );
    }
    else
    {
      puts ( "null" );
    }
  }

  return ( 0 );
}

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

int main(){
	int a[5];
	char t;
	while(cin >> a[0] >> t >> a[1] >> t >> a[2] >> t >> a[3] >> t >> a[4]){
		sort(a,a+5);
		if(a[0] == a[3] || a[1] == a[4]){
			cout << "four card" << endl;
		}
		else if((a[0] == a[1] && a[2] == a[4]) || (a[0] == a[2] && a[3] == a[4])){
			cout << "full house" << endl;
		}
		else if((a[0]+1==a[1]&&a[1]+1==a[2]&&a[2]+1==a[3]&&a[3]+1==a[4]) || (a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13)){
			cout << "straight" << endl;
		}
		else if(a[0] == a[2] || a[1] == a[3] || a[2] == a[4]){
			cout << "three card" << endl;
		}
		else if((a[0]==a[1]&&(a[2]==a[3]||a[3]==a[4]))||(a[1]==a[2]&&a[3]==a[4])){
			cout << "two pair" << endl;
		}
		else if((a[0]==a[1])||(a[1]==a[2])||(a[2]==a[3])||(a[3]==a[4])){
			cout << "one pair" << endl;
		}
		else{
			cout << "null" << endl;
		}
	}
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
string m[7]={"null","one pair","two pair","three card","straight","full house","four card"};
int c[5],ans;
bool s1(){
	bool ok=false;
	for(int i=0;i<4;i++){
		if(c[i]==c[i+1])ok=true;
	}
	return ok;
}
bool s2(){
	bool ok=false;
	if(c[1]==c[2]&&c[3]==c[4])ok=true;
	if(c[0]==c[1]&&c[3]==c[4])ok=true;
	if(c[0]==c[1]&&c[2]==c[3])ok=true;
	return ok;
}
bool s3(){
	bool ok=false;
	for(int i=0;i<3;i++){
		if(c[i]==c[i+1]&&c[i]==c[i+2])ok=true;
	}
	return ok;
}
bool s4(){
	bool ok=true;
	for(int i=0;i<4;i++){
		if(c[i]+1!=c[i+1])ok=false;
	}
	int d[5]={1,10,11,12,13};
	bool A=true;
	for(int i=0;i<5;i++){
		if(c[i]!=d[i])A=false;
	}
	if(A)ok=true;
	return ok;
}
bool s5(){
	bool ok=true;
	if(c[0]!=c[1]||c[3]!=c[4])ok=false;
	if(c[1]!=c[2]&&c[3]!=c[2])ok=false;
	return ok;
}
bool s6(){
	bool ok=false;
	if(c[0]==c[1]&&c[0]==c[2]&&c[0]==c[3])ok=true;
	if(c[4]==c[1]&&c[4]==c[2]&&c[4]==c[3])ok=true;
	return ok;
}
int main(){
	char z;
	while(cin>>c[0]){
		for(int i=1;i<5;i++)cin>>z>>c[i];
		ans=0;
		sort(c,c+5);
		if(s1())ans=1;
		if(s2())ans=2;
		if(s3())ans=3;
		if(s4())ans=4;
		if(s5())ans=5;
		if(s6())ans=6;
		cout<<m[ans]<<endl;
	}
	return 0;
}

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

int main()
{
	vector<int> card(5);
	vector<int> count(13);
	string handName[7] = {"null", "one pair", "two pair", "three card", "straight", "full house", "four card"};
	int hand;
	int max, pair;
	int i;

	while (scanf("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4]) != EOF) {
		fill(count.begin(), count.end(), 0);
		max = 0;
		pair = 0;
		for (i = 0; i < 5; i++) {
			if ( ++count[card[i]-1] > max )
				max = count[card[i]-1];
			if ( count[card[i]-1] == 2 )
				pair++;
		}

		if (max == 4) hand = 6;
		else if (max==3 && pair==2) hand = 5;
		else if (max == 3) hand = 3;
		else if (pair == 2) hand = 2;
		else if (pair == 1) hand = 1;
		else hand = 0;
		if (hand < 4) {
			for (i = 0; i < 13-3; i++) {
				if (count[i]==1 && count[i+1]==1 && count[i+2]==1 && count[i+3]==1 && count[(i+4)%13]==1)
					hand = 4;
			}
		}

		cout<<handName[hand]<<endl;
	}
	return 0;
}

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

void func(int a[]){
  sort(a,a+5);
  int cnt = 1;
  for(int i = 1 ; i < 5 ; i++){
    if(a[1] == 10 && i == 4){
      if(a[0] == 1 && a[4] == 13)cnt++;
    }
    if(a[i-1]+1 == a[i])cnt++;
  }
  if(cnt == 5){
    cout << "straight" << endl;
    return;
  }
  
  int c[14];
  int two,three,four;
  two = three = four = 0;
  for(int i = 0 ; i < 14 ; i++)c[i] = 0;
  for(int i = 0 ; i < 5 ; i++)c[a[i]]++;
  for(int i = 0 ; i < 14 ; i++){
    if(c[i] == 4)four++;
    else if(c[i] == 3)three++;
    else if(c[i] == 2)two++;
  }
  
  if(four == 1){
    cout << "four card" << endl;
    return;
  }
  else if(two == 1 && three == 1){
    cout << "full house" << endl;
    return;
  }
  else if(two == 2){
    cout << "two pair" << endl;
    return;
  }
  else if(two == 1){
    cout << "one pair" << endl;
    return;
  }
  else if(three == 1){
    cout << "three card" << endl;
    return;
  }
  cout << "null" << endl;
}
    

int main(){
  int a[5];
  while(scanf("%d,%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3],&a[4]) != EOF){
    func(a);
  }
  return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
	
int length(int a[]){
	int res=0,len=0;
	for(int i=0;i<14;i++){
		if(a[i])len++;
		else len=0;
		res=max(res,len);
	}
	return res;
}
int main(){
	int a[14];
	int n;
	while(scanf("%d",&n)!=EOF){
		fill(a,a+14,0);
		a[n-1]++;
		if(n==1)a[13]++;
		for(int i=1;i<5;i++){
			scanf(",%d",&n);
			a[n-1]++;
			if(n==1)a[13]++;
		}
		char *ans="null";
		if(count(a,a+13,4)==1) ans="four card";
		else if(count(a,a+13,3)==1 && count(a,a+13,2)==1)ans="full house";
		else if(length(a)==5) ans="straight";
		else if(count(a,a+13,3)==1) ans="three card";
		else if(count(a,a+13,2)==2) ans="two pair";
		else if(count(a,a+13,2)==1) ans="one pair";
		puts(ans);
	}
	return 0;
}