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<algorithm>

using namespace std;
int main(void)
{
	int card[6];
	char kari;
	while(1)
	{
		for(int i = 0;i < 5;i++)
		{
			if(scanf("%d",&card[i])== EOF) goto kitune;
			if(i!= 4) scanf("%c",&kari);
		}
		int cnt = 0,check[15] = {0};
		sort(card,card+5);
		for(int i = 0;i<5;i++)
		{
			check[card[i]]++;
			if(card[i] == 1) check[14] = 1;
		}
		for(int i = 0;i<=14;i++)
		{
			if(check[i] == 1)
			{
				if(check[i+1] == 1) 
				{
					cnt++;
					if(cnt == 4) break;
				}
				else cnt = 0;
			}
		}

		int pair = 0;
		int three = 0;
		int four = 0;
		int st = 0;
		if(cnt == 4)
		{
			printf("straight\n");
			st = 1;
		}
		else
		{
			for(int i = 0;i < 13;i++)
			{
				if(check[i] == 2) pair++;
				if(check[i] == 3) three++;
				if(check[i] == 4) four++;
			}
		}
		if(pair >= 1)
		{
			if(three == 1) printf("full house\n");
			else if(pair == 2) printf("two pair\n");
			else printf("one pair\n");
		}
		else if(three == 1) 
		{
			if(pair == 1) printf("full house\n");
			else printf("three card\n");
		}
		else if(four == 1) printf("four card\n");
		else if(st != 1) printf("null\n");
	}
	kitune:;
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
main(){
  int a[5];
  while(~scanf("%d,%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3],&a[4])){
    int card[14]={};
    int p=1;
    int pan=0;
    int tpan=0;
    for(int i=0;i<5;i++){
      card[a[i]]++;
      if(card[a[i]]>3) p=7;
      else if(card[a[i]]>2){
	tpan++;
	pan--;
      }
      else if(card[a[i]]>1){
	pan++;
      }
    }
    if(p==7) puts("four card");
    else if(tpan==1 && pan==1) puts("full house");
    else if(tpan==1) puts("three card");
    else if(pan==2) puts("two pair");
    else if(pan==1) puts("one pair");
    else{
      bool f=false;
      for(int i=1;i<10;i++){
	for(int j=0;j<5;j++){
	  int ind = (i+j)%14+1;
	  if(!card[ind]) break;
	  if(j==4) f=true;
	}
	if(f) break;
      }
      if(f) puts("straight");
      else
	puts("null");
    }
    
  }
}

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

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

C++: #include <stdio.h>
#include <string.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int cnt[13], ty[8];

bool straight() {
    rep (k, 10) {
        bool f = true;
        rep (i, 5) if (cnt[(k+i)%13] == 0) f = false;
        if (f) return true;
    }
    return false;
}

int main() {
    int a, b, c, d, e;
    while (scanf("%d,%d,%d,%d,%d", &a, &b, &c, &d, &e) != EOF) {
        memset(cnt, 0, sizeof(cnt));
        memset(ty, 0, sizeof(ty));
        a--, b--, c--, d--, e--;
        cnt[a]++;
        cnt[b]++;
        cnt[c]++;
        cnt[d]++;
        cnt[e]++;
        rep (i, 13) ty[cnt[i]]++;
        if (ty[4]) puts("four card");
        else if (ty[2] && ty[3]) puts("full house");
        else if (straight()) puts("straight");
        else if (ty[3]) puts("three card");
        else if (ty[2] >= 2) puts("two pair");
        else if (ty[2] >= 1) puts("one pair");
        else puts("null");
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

using db = double;
using ll = long long;
using vi = vector <int>;
#define op operator
#define pb push_back

int a[5];
int c[14];

int main() {
	ios :: sync_with_stdio(0);

	while(cin >> a[0]) {
		char t;
		for(int i = 1; i < 5; i ++)
			cin >> t >> a[i];
		fill(c, c + 14, 0);
		for(int i = 0; i < 5; i ++)
			c[a[i]] ++;

		auto f = [&](int i) {
			return count(c, c + 14, i);
		};
		auto straight = [&]() {
			bool r = 0;
			for(int i = 1; i <= 10; i ++) {
				bool t = 1;
				for(int j = i; j < i + 5; j ++)
					if(!c[(j - 1) % 13 + 1])
						t = 0;
				r |= t;
			}
			return r;
		};

		if(f(4))
			cout << "four card\n";
		else if(f(3) && f(2))
			cout << "full house\n";
		else if(straight())
			cout << "straight\n";
		else if(f(3))
			cout << "three card\n";
		else if(f(2) == 2)
			cout << "two pair\n";
		else if(f(2))
			cout << "one pair\n";
		else
			cout << "null\n";
	}

	return 0;
}

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

using namespace std;

int a[5];

bool st(){
	int i=a[0];
	if((a[1]==i+1&&a[2]==i+2&&a[3]==i+3&&a[4]==i+4)||(i==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13)){
		return 1;
	}
	return 0;
}

void f(int a,int b,int c){
	if(c)cout<<"four card\n";
	else if(a&&b)cout<<"full house\n";
	else if(b)cout<<"three card\n";
	else if(a==2)cout<<"two pair\n";
	else if(a)cout<<"one pair\n";
	else cout<<"null\n";
}

int main(){
	while(~scanf("%d,%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3],&a[4])){
		sort(a,a+5);
		if(st())cout<<"straight\n";
		else{
			int num[14],pair=0,three=0,four=0;
			for(int i=1;i<14;i++)num[i]=0;
			for(int i=0;i<5;i++)num[a[i]]++;
			for(int i=1;i<14;i++){
				if(num[i]==2)pair++;
				else if(num[i]==3)three++;
				else if(num[i]==4)four++;
			}
			f(pair,three,four);
		}
	}
}