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++: #define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 5
#define MIN -100001
#define _MAX 8
#define ONE 1
#define TWO 2
#define THREE 3
#define FOUR 6
#define FULL 5
#define STRAIT 4
int main(void)
{
	char *a[_MAX] = { "null","one pair","two pair","three card","straight","full house","four card" };
	int card[5], cou[5] = { 0 }, ans;
	int bo = 1, x;
	while (scanf_s("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4 ]) != EOF) {
		ans = 0;
		for (int i = 0; i < MAX; ++i) {
			cou[i] = 0;
			for (int j = MAX - 1; j > i; --j) {
				if (card[j] < card[j - 1]) {
					x = card[j]; card[j] = card[j - 1]; card[j - 1] = x;
				}
			}
		}
		for (int i = 0; i < MAX - 1; ++i) 
			if (card[i] == card[i + 1]) ++cou[i + 1] += cou[i];

		for (int i = 0; i < MAX; ++i) {
			if (i + 1 == MAX || cou[i + 1] == 0) {
				if (cou[i] > 0) {
					//1...one, 2...1.1, 3...2 4...3,5...2,1
					if (ans == 0) {
						//??????????????????1???
						if (cou[i] == 1) ans = ONE;
						else if (cou[i] == 2) ans = THREE;
						else if (cou[i] == 3) { ans = FOUR; break; }
					}
					else if (ans == ONE) {
						if (cou[i] == 1) { ans = TWO; break; }
						else if (cou[i] == 2) { ans = FULL; break; }
					}
					else if (ans == THREE) {
						if (cou[i] == 1) { ans = FULL; break; }
					}
				}
			}
		}
		if (ans == 0) {
			for (int i = MAX - 1; i >= 1; --i) {
				if (i == 1) {
					if (card[i] == card[i - 1] + 1) ans = STRAIT;
					else {
						if (card[4] == 13 && card[0] == 1) ans = STRAIT;
					}
				}
				if (card[i] != card[i - 1] + 1) break;
			}
		}
		printf("%s\n",a[ans]);
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

int card[5];

int c[13];

void solve(){
	memset(c,0,sizeof(c));
	REP(i,5){
		c[card[i]-1]++;
	}
	bool f1=false,f2=false;
	REP(i,13){
		if (c[i]>=4){
			f1=true;
		}
	}
	if (f1){
		cout<<"four card"<<endl;
		return;
	}
	REP(i,13){
		if (c[i]==3){
			f1=true;
		}else if (c[i]==2){
			f2=true;
		}
	}
	if (f1 && f2){
		cout<<"full house"<<endl;
		return;
	}
	f1=f2=false;
	REP(i,10){
		bool f=true;
		REP(j,5){
			if (c[(i+j)%13]!=1){
				f=false;
			}
		}
		if (f){
			f1=true;
		}
	}
	if (f1){
		cout<<"straight"<<endl;
		return;
	}
	REP(i,13){
		if (c[i]==3){
			f1=true;
		}
	}
	if (f1){
		cout<<"three card"<<endl;
		return;
	}
	int k=0;
	REP(i,13){
		if (c[i]==2){
			k++;
		}
	}
	if (k==2){
		cout<<"two pair"<<endl;
	}else if (k==1){
		cout<<"one pair"<<endl;
	}else{
		cout<<"null"<<endl;
	}
}

int main(){
	while (scanf("%d,%d,%d,%d,%d",card,card+1,card+2,card+3,card+4)!=EOF){
		solve();
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int a[5], p, s; char T; string S[7] = { "four card","full house","straight","three card","two pair","one pair","null" };
int main() {
	while (cin >> a[0] >> T >> a[1] >> T >> a[2] >> T >> a[3] >> T >> a[4]) {
		sort(a, a + 5);
		for (int i = 0; i < 2; i++) {
			if (a[i] == a[i + 1] && a[i + 1] == a[i + 2] && a[i + 2] == a[i + 3]) {
				p = 0; goto E;
			}
		}
		if (a[0] == a[1] && a[2] == a[3] && a[3] == a[4]) {
			p = 1; goto E;
		}
		if (a[0] == a[1] && a[1] == a[2] && a[3] == a[4]) {
			p = 1; goto E;
		}
		if ((a[0] != a[1] && a[1] != a[2] && a[2] != a[3]) && (a[3] != a[4] && a[0] == a[4] - 4)) {
			p = 2; goto E;
		}
		for (int i = 0; i < 3; i++) {
			if (a[i] == a[i + 1] && a[i + 1] == a[i + 2]) {
				p = 3; goto E;
			}
		}
		s = 0;
		for (int i = 0; i < 4; i++) {
			if (a[i] == a[i + 1]) {
				s++; goto E;
			}
		}
		if (s >= 2) { p = 4; goto E; }
		if (s == 1) { p = 5; goto E; }
		p = 6;
	E:;
		cout << S[p] << endl;
	}
}

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

#define N 5

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

	while (scanf("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4]) != EOF) {
		sort(card.begin(), card.end());

		hand = 0;

		for (i = 1; i < N; i++) {
			if (card[i-1] == card[i]) hand = 1;
		}

		same = 0;
		series = 0;
		for (i = 1; i < N; i++) {
			if (card[i-1] == card[i]) {
				same++;
				if (same==2) {
					hand = 3;
					break;
				} else if (same==1 && series==1) {
					hand = 2;
				}
			} else {
				if (same) series++;
				same = 0;
			}
		}

		series = 0;
		for (i = 1; i < N; i++)
			if (card[i] == card[i-1]+1) series++;
		if (series == 4) hand = 4;
		if (card[0]==1 && card[1]==10 && card[2]==11 && card[3]==12 && card[4]==13)
			hand = 4;

		same = 0;
		series = 0;
		for (i = 1; i < N; i++) {
			if (card[i-1] == card[i]) {
				same++;
				if (same==2 && series==1) {
					hand = 5;
					break;
				}
			} else {
				if (same) series++;
				same = 0;
			}
		}

		same = 0;
		for (i = 1; i < N; i++) {
			if (card[i-1] == card[i]) {
				same++;
				if (same==3) {
					hand = 6;
					break;
				}
			} else {
				same = 0;
			}
		}

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

C++: #include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
int main(void)
{
  for(;;){
    int n[5];
    char c;
    REP(i,5){
      if(i) cin >> c;
      if(cin >> n[i] == 0) return 0;
    }
    int num[16];
    REP(i,16) num[i]=0;
    REP(i,5) ++num[n[i]];
    num[14]=num[1];
    string s="null";
    REP(i,11){
      int st=0;
      REP(j,5) if(num[i+j]) ++st;
      if(st==5) s="straight";
    }
    int pa=0;
    REP(i,5) REP(j,i) if(n[i]==n[j]) ++pa;
    if(pa==1) s="one pair";
    if(pa==2) s="two pair";
    if(pa==3) s="three card";
    if(pa==4) s="full house";
    if(pa==6) s="four card";
    cout << s << endl;



  }
}