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

void check_multiplicity(const int* sorted_cards, std::map<int,int>& multiplicities)
{
	multiplicities.clear();

	const int* current = sorted_cards;
	const int* end = sorted_cards + 5;
	while (current != end) {
		const int* next = std::upper_bound(current, end, *current);
		++multiplicities[next - current];
		current = next;
	}
}

int count(const std::map<int,int> multiplicities, int multiplicity)
{
	std::map<int,int>::const_iterator i = multiplicities.find(multiplicity);
	return (i != multiplicities.end()) ? i->second : 0;
}

bool check_straight(const int* sorted_cards, std::map<int,int> multiplicities)
{
	if (count(multiplicities, 1) != 5) {
		return false;
	}
	return (sorted_cards[4] == sorted_cards[0] + 4)
		|| (sorted_cards[0] == 1 && sorted_cards[1] == 10);
}

int main()
{
	int cards[5] = {};
	while (scanf("%d,%d,%d,%d,%d",&cards[0],&cards[1],&cards[2],&cards[3],&cards[4]) == 5) {
		std::sort(cards, cards + 5);
		std::map<int,int> multiplicities;
		check_multiplicity(cards, multiplicities);

		if (count(multiplicities, 4) > 0) {
			std::cout << "for card\n";
		} else if (count(multiplicities, 3) > 0 && count(multiplicities, 2) > 0) {
			std::cout << "full house\n";
		} else if (check_straight(cards, multiplicities)) {
			std::cout << "straight\n";
		} else if (count(multiplicities, 3) > 0) {
			std::cout << "three card\n";
		} else if (count(multiplicities, 2) == 2) {
			std::cout << "two pair\n";
		} else if (count(multiplicities, 2) == 1) {
			std::cout << "one pair\n";
		} else {
			std::cout << "null\n";
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
bool find_two(vector<int> v, int mode[14]) {
    for(int r = 0; r < 5; r++) {
        if(mode[v[r]] == 2) return(true);
    }
    return(false);
}
bool isSequencial(vector<int> v) {
    if((v[0]==1&&v[1]==2&&v[2]==3&&v[3]==4&&v[4]==5) || (v[0]==1&&v[1]==10&&v[2]==11&&v[3]==12&&v[4]==13)) { return(true);}
    for(int r = 1; r < 5; r++) {
        if(v[r] - 1 != v[r - 1]) return(false);
    }
    return(true);
}

int main(void) {
    vector<int> v(5);
    while(scanf("%d,%d,%d,%d,%d", &v[0], &v[1], &v[2], &v[3], &v[4]) != EOF) {
        //頻度記録
        int mode[14]; memset(mode, 0, sizeof(mode));
        int max = -1;
        for(int r = 0; r < 5; r++) {
            mode[v[r]]++; if(mode[v[r]] > max) max = mode[v[r]];
        }
        sort(v.begin(), v.end());
        if(max == 4) {
            cout << "four card" << endl;
        } else if(max == 3) {
            if(find_two(v, mode)) cout << "full house" << endl;
            else                  cout << "three card" << endl;
        } else if(isSequencial(v)) {
            cout << "straight" << endl;
        } else if(max == 2) {
            int count = 0;
            for(int r = 0; r < 14; r++) {
                if(mode[r] == 2) count++;
            }
            if(count == 2) {
                cout << "two pair" << endl;
            } else if(count == 1) {
                cout << "one pair" << endl;
            } else cout << "null" << endl;
        } else {
            cout << "null" << endl;
        }
    }
    return(0);
}

C++: #include <stdio.h>
int main() {int RB[15],t,p,f,l,i;while (scanf("%d",&t)!=EOF) {for (i=0;i<15;RB[i++]=0);RB[t]++;for (i=1;i<5;i++) scanf(",%d",&t),RB[t]++;t=p=f=l=0;for (i=0;i<15;i++) if (RB[i]==4) f++; else if (RB[i]==3) t++; else if (RB[i]==2) p++;RB[14]=RB[1];for (i=1;i<11;i++) if (RB[i]*RB[i+1]*RB[i+2]*RB[i+3]*RB[i+4]) l=1;if (l) puts("straight"); else if (f) puts("four card"); else if (t && p) puts("full house"); else if (t) puts("three card"); else if (p==2) puts("two pair"); else if (p) puts("one pair"); else puts("null");}return 0;}

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

int main() {
  int card[5];
  
  while(scanf("%d,%d,%d,%d,%d\n", &card[0], &card[1], &card[2], &card[3], &card[4] ) != EOF) {
    
    int isStraight = 1;
    sort(card, card + 5);
    if( card[0] == card[1]-1 || card[4] == 13 && card[0] == 1 ) isStraight ++;
    for(int i=1; i<4; i++) {
      if(card[i] + 1 == card[i+1]) isStraight ++;
    }
    
    if( isStraight == 5 ) {
      cout << "straight" << endl;
      continue;
    }

    int cdcnt[14]; fill(cdcnt, cdcnt+14, 0);
    for(int i=0; i<5; i++) {
      cdcnt[card[i]-1] ++;
    }

    int mxpair = 0;    
    for(int i=0; i<13; i++) {
      mxpair = max(mxpair, cdcnt[i]);
    }
    
    if( mxpair == 4 ) {
      cout << "four card" << endl;
    } 

    else if( mxpair == 3 ) {
      for(int i=0; i<5; i++) {
	if( cdcnt[card[i]-1] == 2 ) {
	  cout << "full house" << endl;
	  goto Fin;
	}
      }
      cout << "three card" << endl;
    }
    
    else if( mxpair == 2 ) {
      int twopaircnt = 0;
      
      for(int i=0; i<5; i++) {
	if( cdcnt[card[i]-1] == 2 ) twopaircnt ++;
      }
      if( twopaircnt == 2 ) {
	cout << "one pair" << endl;
      } else {
	cout << "two pair" << endl;
      }
    }
    
    else {
      cout << "null" << endl;
    }

  Fin:
    ;
  }
  
  
  return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

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

static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;


int a[5]={0};
int c[14]={0};
int node;
char t;
int tmp;

int main(){
	while(cin>>tmp){
		c[tmp]++;
		rep(i,4){
			cin>>t>>tmp;
			c[tmp]++;
		}
		rep(i,14){
			a[c[i]]++;
		}
		bool str=false;
		rep(i,10){
			if(c[i]==1){
				rep(j,4){
					if(c[i+j+1]!=1){
						str=false;
						break;
					}
					else if(j==3) str=true;
				}
				break;
			}
		}
		//rep(i,13) cout<<c[i+1]<<" ";
		//cout<<endl;
		if(c[1]==1&&c[10]==1&&c[11]==1&&c[12]==1&&c[13]==1) str=true;
		if(a[4]==1) cout<<"four card\n";
		else if(a[3]==1&&a[2]==1) cout<<"full house\n";
		else if(str) cout<<"straight\n";
		else if(a[3]==1) cout<<"three card\n";
		else if(a[2]==2) cout<<"two pair\n";
		else if(a[2]==1) cout<<"one pair\n";
		else cout<<"null\n";
		
		rep(i,14) c[i]=0;
		rep(i,5) a[i]=0;
	}
	return 0;
}