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<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  vector<int> a(5);
  while(cin>>a[0]){
    char d;
    string ans;
    rep(i,4)cin>>d>>a[i+1];
    sort(all(a));
    int co=1;
    rep(i,4)if(a[i]!=a[i+1])co++;
    if(a[0]==a[3]||a[1]==a[4])ans="four card";
    else if((a[0]==a[2])&&(a[3]==a[4])||(a[2]==a[4])&&(a[0]==a[1]))ans="full house";
    else if((a[0]==a[2])||(a[1]==a[3])||(a[2]==a[4]))ans="three card";
    else if(co==3)ans="two pair";
    else if(co==4)ans="one pair";
    else if((a[4]-a[0]==4)||(a[1]-a[0]==9)||(a[4]-a[3]==9))ans="straight";
    else ans="null";
    cout<<ans<<endl;
  }
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int straight(int c[]){
    int sum = 0;
    rep(i,5){
        sum += c[i];
    }
    if(sum / 5 == c[2]){
        return 1;
    }else if(sum == 47){
        return 1;
    }else{
        return 0;
    }
}

int main(){
    int c[5];
    char g;
    int p,k;

    while(cin >> c[0] >> g >> c[1] >> g >> c[2] >> g >> c[3] >> g >> c[4]){
        int count[5] = {0};
        k = 0;
        sort(c, c+5);
        p = c[0];
        for(int i = 0; i < 5; i++){
            if(p == c[i]){
                count[k]++;
            }else{
                p = c[i];
                k++;
                count[k]++;
            }
        }
        sort(count, count+5);
        if(count[4] == 2){
            if(count[3] == 2){
                cout << "two pair" << endl;
            }else{
                cout << "one pair" << endl;
            }
        }else if(count[4] == 3){
            if(count[3] == 2){
                cout << "full house" << endl;
            }else{
                cout << "three card" << endl;
            }
        }else if(count[4] == 4){
            cout << "four card" << endl;
        }else{
            if(straight(c) == 1){
                cout << "straight" << endl;
            }else{
                cout << "null" << endl;
            }
        }
    }
}

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

using namespace std;

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

    int cnt[15];
    fill(cnt,cnt+15,0);
    for(int i=0;i<5;i++){
      cnt[x[i]]++;
      if(x[i]==1)cnt[14]++;
    }

    int fg=0;
    for(int i=0;i<15;i++)
      if(cnt[i]==4){
	cout << "four card" << endl;
	fg=1;
	break;;
      }
    if(fg)continue;

    int fg2=0,fg3=0;
    for(int i=0;i<14;i++){
      if(cnt[i]==2)fg2++;
      if(cnt[i]==3)fg3=1;
    }
    if(fg2 && fg3){
      	cout << "full house" << endl;
	continue;
    }

    for(int i=0;i+4<15;i++){
      if(cnt[i] & cnt[i+1] & cnt[i+2] & cnt[i+3] &cnt[i+4]){
	cout << "straight" << endl;
	fg=1;
	break;;
      }
    }
    if(fg)continue;

    if(fg3){
      cout << "three card" << endl;
      continue;
    }

    if(fg2==2){
      cout << "two pair" << endl;
      continue;
    }

    if(fg2==1){
      cout <<"one pair" << endl;
      continue;
    }

    cout << "null" << endl;
  }

  return 0;
}

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

using namespace std;

string str[] = {"null", "one pair", "two pair", "three card",
    "straight", "full house", "four card"};

int main()
{
    int hand[5];
    while (scanf("%d", &hand[0]) != EOF) {
        for (int i = 1; i < 5; i++) {
            scanf(",%d", &hand[i]);
        }
        int data[14];
        fill(data, data+14, 0);
        for (int i = 0; i < 5; i++) {
            data[hand[i]]++;
        }
        int ans = 0;
        for (int i = 1; i < 14; i++) {
            if (data[i] == 4) {
                ans = 7;
            }
            if (data[i] == 2) {
                if (ans == 2) {
                    ans = 3;
                } else if (ans == 4) {
                    ans = 6;
                } else {
                    ans = 2;
                }
            }
            if (data[i] == 3) {
                if (ans == 2) {
                    ans = 6;
                } else {
                    ans = 4;
                }
            }
        }
        sort(hand, hand+5);
        if (!ans) {
            for (int i = 1; i < 5; i++) {
                if (hand[i-1]+1 != hand[i] ) {
                    ans = 1;
                }
            }
            if (ans != 1) {
                ans = 5;
            }
            if (hand[0] == 1 && hand[1] == 10 && hand[2] == 11 &&
                    hand[3] == 12 && hand[4] == 13) {
                ans = 5;
            }
        }
        cout << str[ans-1] << endl;

    }

    return 0;
}

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

using namespace std;

int straight(int[]);

int main() {

	int ans, h[5];

	while(scanf("%d,%d,%d,%d,%d", &h[0], &h[1], &h[2], &h[3], &h[4])!=EOF) {
		ans=0;
		for(int i=0; i<4; i++) {
			for(int j=i+1; j<5; j++) {
				if(h[i]==h[j])
					ans++;
			}
		}
		switch(ans) {
			case 1:
				cout << "one pair" << endl;
				break;
			case 2:
				cout << "two pair" << endl;
				break;
			case 3:
				cout << "three cards" << endl;
				break;
			case 4:
				cout << "full house" << endl;
				break;
			case 6:
				cout << "four cards" << endl;
				break;
			default:
				if(straight(h))
					cout << "straight" << endl;
				else
					cout << "null" << endl;
		}
	}
	
	return 0;

}

int straight(int h[5]) {
	
	sort(h, h+5);
	for(int i=0; i<9; i++) {
		if(h[0]==i&&h[1]==i+1&&h[2]==i+2&&h[3]==i+3&&h[4]==i+4||h[0]==1&&h[1]==10&&h[2]==11&&h[3]==12&&h[4]==13)
			return 1;
	}

	return 0;

}