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 <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
#include <complex>
#include <climits>
using namespace std;

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8

/*
one : 18
two : 21
three : 33
full house : 36
four card : 84

*/
int d[5];
int card[15];

bool isstraight(){
	for(int i=1; i<=10; i++){
		if( card[i]==3 && card[i+1]==3 && card[i+2]==3 &&
				card[i+3]==3 && card[i+4]==3 ) return true;
	}
	return false;
}
int main(){
	while(~scanf("%d,%d,%d,%d,%d",d,d+1,d+2,d+3,d+4)){
		rep(i,15)card[i]=1;
		rep(i,5){
			if( d[i]==1 ) card[14]*=3;
			card[d[i]]*=3;
		}
		int sum = 0;
		rep(i,14)if( card[i]>1 )sum+=card[i];
		
		if( isstraight() ){
			puts("straight");
		}else if( sum==18 ){ //one
			puts("one pair");
		}else if( sum==21 ){ //two
			puts("two pair");
		}else if( sum==33 ){ 
			puts("three card");
		}else if( sum==36 ){
			puts("full house");
		}else if( sum==84 ){
			puts("four card");
		}else{
			puts("null");
		}
		
		//rep(i,14)printf("%d ",card[i]); printf("sum:%d\n",sum);
		
	}
	return 0;
}

C++: #include <stdio.h>

int compare_int (const void* a,const void* b) {

  return (*(int*)a-*(int*)b);

}

int main(void) {

  int hand[5];
  
  int overlap[5];
  int used[5];

  int count;
  int full_or_three=-1;
  int two_or_one=-1;
  int temp;
  int i,j,k,l,m=0;

  char c;

  while(scanf("%d,%d,%d,%d,%d",&hand[0],&hand[1],&hand[2],&hand[3],&hand[4])!=EOF) {

    //sort current hand
    qsort(hand,sizeof(hand)/sizeof(hand[0]),sizeof(int),compare_int);

    //for(i=0;i<5;i++) printf("%d ",hand[i]);
  
    //count overlapped cards
    count=0;

    for(i=0;i<5;i++) {

      overlap[i]=0;
      used[i]=0;
    }

    for(i=0;i<4;i++) {

      if(used[i]==1) continue;
    
      for(j=i+1;j<5;j++) {

	if(used[j]==0 && hand[i]==hand[j]) {

	  overlap[count]++;

	  used[i]=used[j]=1;

	}

      }

      used[i]=1;

      count++;

    }

    //for(i=0;i<5;i++) printf("%d ",overlap[i]);

    //check overlapped cards
  
    //four card?
    for(i=0;i<5;i++) {

      if(overlap[i]==3) {

	printf("four card\n");

	goto Terminate;
      
      }

    }

    //full house or three card?
    for(i=0;i<5;i++) {
    
      if(overlap[i]==2) {

	for(j=0;j<5;j++) {

	  if(overlap[j]==1) {

	    printf("full house\n");

	    goto Terminate;

	  }

	}

	printf("three card\n");

	goto Terminate;

      }

    }

    if(full_or_three==1) {

      for(i=0;i<5;i++) {

	if(overlap[i]==1) {

	  printf("full house\n");

	  goto Terminate;

	}

	else {

	  printf("three card\n");

	  goto Terminate;

	}

      }

    }

    //straight?
    if(hand[0]+1==hand[1] && hand[1]+1==hand[2] && hand[2]+1==hand[3] && hand[3]+1==hand[4] || (hand[0]==1 && hand[1]==10 && hand[2]==11 && hand[3]==12 && hand[4]==13)) {

      printf("straight\n");

      goto Terminate;

    }

    //two pair or one pair?
    for(i=0;i<4;i++) {

      if(overlap[i]==1) {

	for(j=i+1;j<5;j++) {

	  if(overlap[j]==1) {

	    printf("two pair\n");

	    goto Terminate;

	  }

	}

	printf("one pair\n");

	goto Terminate;

      }

    }

    //null
    printf("null\n");

  Terminate:
    continue;

  }

  return 0;

}

C++: #include<iostream>
#include<algorithm>
using namespace std;
 
 
int main(void)
{
    const int N = 5;
    while(1)
    {
        int hand[N];
        char dummy;
        int i, j;
        for(i = 0; i < N; i++)
        {
            if(i)
                cin >> dummy;
            cin >> hand[i];
        }
        if(!cin)
            break;
 
        sort(hand, hand+N);
 
        if(hand[0] == hand[3] ||
            hand[1] == hand[4])
            cout << "four card" << endl;
        else if( (hand[0] == hand[1] && hand[2] == hand[4]) ||
                (hand[0] == hand[2] && hand[3] == hand[4]) )
            cout << "full house" << endl;
        else if( (hand[0] == 1 && hand[1] == 10 && hand[2] == 11 && hand[3] == 12 && hand[4] == 13) ||
            (hand[0]+1==hand[1] && hand[1]+1==hand[2] && hand[2]+1==hand[3] && hand[3]+1==hand[4]) )
            cout << "straight" << endl;
        else if( (hand[0] == hand[2] || hand[1] == hand[3] || hand[2] == hand[4]) )
            cout << "three card" << endl;
        else if( (hand[0]==hand[1] && hand[2]==hand[3]) ||
                (hand[0]==hand[1] && hand[3]==hand[4]) ||
                (hand[1]==hand[2] && hand[3]==hand[4]) )
            cout << "two pair" << endl;
        else if( hand[0]==hand[1] || hand[1]==hand[2] || hand[2]==hand[3] || hand[3]==hand[4] )
            cout << "one pair" << endl;
        else
            cout << "null" << endl;
    }
    return 0;
}

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

int main(){
int c[6],s[6],ans=0;
string a[7];
a[0]="null";
a[1]="one pair";
a[2]="two pair";
a[3]="three card";
a[4]="straight";
a[5]="full house";
a[6]="four card";
while(scanf("%d,%d,%d,%d,%d",&c[0],&c[1],&c[2],&c[3],&c[4])!=EOF){
ans=0;
for(int i=0;i<5;i++)s[i]=100;
s[0]=c[0];
for(int i=1;i<5;i++){
for(int j=i-1;j>-1;j--){
if(s[j]<=c[i]){
for(int k=i;k>j+1;k--)s[k]=s[k-1];
s[j+1]=c[i];
break;}}
if(s[0]>c[i]){
for(int k=i;k>0;k--)s[k]=s[k-1];
s[0]=c[i];}}
if(s[0]==s[1]||s[1]==s[2]||s[3]==s[4]||s[2]==s[3])ans=1;
if((s[0]==s[1]||s[1]==s[2])&&(s[2]==s[3]||s[3]==s[4]))ans=2;
if(s[0]==s[2]||s[1]==s[3]||s[2]==s[4])ans=3;
if(s[2]+1==s[3]&&s[1]+1==s[2]&&s[3]+1==s[4]&&(s[0]+1==s[1]||(s[0]==1&&s

[4]==13)))ans=4;
if((s[0]==s[2]&&s[3]==s[4])||(s[0]==s[1]&&s[2]==s[4]))ans=5;
if(s[0]==s[3]||s[1]==s[4])ans=6;

for(int i=0;i<7;i++){if(ans==i)cout<<a[i]<<endl;}

}

}