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 <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    int a[5];
    char t;
    while(cin >> a[0] >> t >> a[1] >> t >> a[2] >> t >> a[3] >> t >> a[4])
    {
        sort(a,a+5);
        if(a[0] == a[3] || a[1] == a[4])
        {
            cout << "four card" << endl;
        }
        else if((a[0] == a[1] && a[2] == a[4]) || (a[0] == a[2] && a[3] == a[4]))
        {
            cout << "full house" << endl;
        }
        else if((a[0]+1==a[1]&&a[1]+1==a[2]&&a[2]+1==a[3]&&a[3]+1==a[4]) || (a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13))
        {
            cout << "straight" << endl;
        }
        else if(a[0] == a[2] || a[1] == a[3] || a[2] == a[4])
        {
            cout << "three card" << endl;
        }
        else if((a[0]==a[1]&&(a[2]==a[3]||a[3]==a[4]))||(a[1]==a[2]&&a[3]==a[4]))
        {
            cout << "two pair" << endl;
        }
        else if((a[0]==a[1])||(a[1]==a[2])||(a[2]==a[3])||(a[3]==a[4]))
        {
            cout << "one pair" << endl;
        }
        else
        {
            cout << "null" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	char a;
	int c[5]={0};
	while(cin>>c[4]>>a>>c[3]>>a>>c[2]>>a>>c[1]>>a>>c[0]){
		sort(c,c+5);
		//cout<<c[4]<<" "<<c[3]<<" "<<c[2]<<" "<<c[1]<<" "<<c[0];
		if(c[4]==c[1]||c[3]==c[0])cout<<"four card"<<endl;
		else if((c[4]==c[2]&&c[0]==c[1])||(c[0]==c[2]&&c[3]==c[4]))cout<<"full house"<<endl;
		else if((c[4]==(c[3]+1)&&c[3]==(c[2]+1)&&c[2]==(c[1]+1)&&c[1]==(c[0]+1))||(c[0]==1&&c[1]==10&&c[2]==11&&c[3]==12&&c[4]==13))cout<<"straight"<<endl;
		else if((c[4]==c[2]&&c[1]!=c[0])||c[3]==c[1]||(c[2]==c[0]&&c[4]!=c[3]))cout<<"three card"<<endl;
		else if((c[4]==c[3]&&(c[2]==c[1]||c[1]==c[0]))||(c[3]==c[2]&&c[1]==c[0])||(c[1]==c[0]&&(c[4]==c[3]||c[3]==c[2])))cout<<"two pair"<<endl;
		else if(c[4]==c[3]||c[3]==c[2]||c[2]==c[1]||c[1]==c[0])cout<<"one pair"<<endl;
		else cout<<"null"<<endl;
	}
}

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

using namespace std;

int main(){

  vector<int> card(5);
  
  while(scanf("%d,%d,%d,%d,%d",&card[0],&card[1],&card[2],&card[3],&card[4]) != EOF){
	bool judge_1p = false;
	bool judge_2p = false;
	bool judge_3 = false;
	bool judge_4 = false;
	bool judge_s = false;

	int pair = 0;
	

	sort(card.begin(),card.end());
	
	for(int i=0;i<4;++i){
	  int count = 1;
	  for(int j=i+1;j<5;++j){
		if(card[i]==card[j])
		  count++;
		else{
		  i = j-1;
		  break;
		}
	  }
	  if(count == 2){
		if(judge_1p == false)
		  judge_1p = true;
		else if(judge_1p==true)
		  judge_2p = true;
	  }
	  else if(count == 3)
		judge_3 = true;

	  else if(count == 4)
		judge_4 = true;
	  
	}

	if(card[0] == 1 && card[1] == 10 && card[2] == 11 && card[3] == 12 && card[4] == 13){
	  cout<<"straight"<<endl;
	  continue;
	} 
	
	for(int i=0;i<4;++i){
	  if(card[i] == card[i+1] - 1 && i == 3)
		judge_s = true;
		
	  else if(card[i] != card[i+1] - 1)
		break;
	}

	if(judge_4 == true)
	  cout<<"four card"<<endl;
	else if(judge_3 == true && judge_1p == true )
	  cout<<"full house"<<endl;
	else if(judge_3 == true)
	  cout<<"three card"<<endl;
	else if(judge_2p == true)
	  cout<<"two pair"<<endl;
	else if(judge_1p == true)
	  cout<<"one pair"<<endl;
	else if(judge_s == true)
	  cout<<"straight"<<endl;
	else
	  cout<<"null"<<endl;
  }
  
}

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

int main() {
int a[5];
char q,w,e,r;
while(cin>>a[0]>>q>>a[1]>>w>>a[2]>>e>>a[3]>>r>>a[4]){
	for(int kk=0;kk<=3;kk++){
		for(int ll=kk+1;ll<=4;ll++){
			if(a[kk]>a[ll]){
				int t;
				t=a[ll];
				a[ll]=a[kk];
				a[kk]=t;
			}
		}
	}
	if(a[0]==a[3]||a[1]==a[4]){
		cout<<"four card"<<endl;
	}
	else{
		if((a[0]==a[2]&&a[3]==a[4])||(a[0]==a[1]&&a[2]==a[4])){
			cout<<"full house"<<endl;
		}
		else{
			if(((a[0]+1==a[1])&&(a[1]+1==a[2])&&(a[2]+1==a[3])&&(a[3]+1==a[4]))||(a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13)){
				cout<<"straight"<<endl;
			}
			else{
				if(a[0]==a[2]||a[1]==a[3]||a[2]==a[4]){
					cout<<"three card"<<endl;
				}
				else{
					if((a[0]==a[1]&&a[2]==a[3])||(a[0]==a[1]&&a[3]==a[4])||(a[1]==a[2]&&a[3]==a[4])){
						cout<<"two pair"<<endl;
					}
					else{
						if(a[0]==a[1]||a[1]==a[2]||a[2]==a[3]||a[3]==a[4]){
							cout<<"one pair"<<endl;
						}
						else{
							cout<<"null"<<endl;
						}
					}
				}
			}
		}
	}
}
	return 0;
}