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<algorithm>
#include<vector>
#include<sstream>
using namespace std;

vector<string> split(const string &str, char delim){
  istringstream iss(str); string tmp; vector<string> res;
  while(getline(iss, tmp, delim)) res.push_back(tmp);
  return res;
}

bool forcard(vector<int> card){
	int ans =1;
	for(int i=0;i<5;i++){
		int x = card[i];
		for(int j=0;j<5;j++){
			if(i!=j){
				if(x == card[j]) ans++;
			}
		}
		if(ans >= 4) return true;
		ans = 1;
	}
	return false;
}

bool fullhouse(vector<int> card){

		for(int i=0,k;i<5;i++){
			int x = card[i],y; int ansx =1,ansy=1;
			for(k=0;k<5;k++) if(card[k] != x){ y = card[k]; break;};
			for(int j=0;j<5;j++){
				if(i!=j){
					if(x == card[j]) ansx++;
				}
				if(k!=j){
					if(y == card[j]) ansy++;
				}
			}
			if(ansx == 3 && ansy ==2) return true;
			if(ansx == 2 && ansy ==3) return true;
		}
		return false;
}

bool straight(vector<int> card){
	int ans = 1;
	if(card[0] == 1){
			for(int i=0;i+1<4;i++){
				if(card[1]+i+1 == card[i+2]) ans++;
			}
			if(card[4] == 13 && ans == 4) return true;
		}
	ans = 1;
		for(int i=0;i+1<5;i++){
			if(card[0]+i+1 == card[i+1]) ans++;
		}
		if(ans==5) return true;

	return false;
}

bool threecard(vector<int> card){
	int ans =1;
	for(int i=0;i<5;i++){
		int x = card[i];
		for(int j=0;j<5;j++){
			if(i!=j){
				if(x == card[j]) ans++;
			}
		}
		if(ans == 3) return true;
		ans = 1;
	}
	return false;
}

bool twopair(vector<int> card){

		for(int i=0,k;i<5;i++){
			int x = card[i],y; int ansx =1,ansy=1;
			for(k=0;k<5;k++) if(card[k] != x){ y = card[k]; break;};
			for(int j=0;j<5;j++){
				if(i!=j){
					if(x == card[j]) ansx++;
				}
				if(k!=j){
					if(y == card[j]) ansy++;
				}
			}
			if(ansx == 2 && ansy ==2) return true;
		}
		return false;
}

bool onepair(vector<int> card){
	int ans =1;
	for(int i=0;i<5;i++){
		int x = card[i];
		for(int j=0;j<5;j++){
			if(i!=j){
				if(x == card[j]) ans++;
			}
		}
		if(ans == 2) return true;
		ans = 1;
	}
	return false;
}
string poker(vector<int> card){
	if(forcard(card)) {return "four card"; } else
	if(fullhouse(card)){ return "full house"; } else
 	if(straight(card)){return "straight";} else
	if(threecard(card)){ return "three card";} else
	if(twopair(card)){ return "two pair";} else
	if(onepair(card)){ return "one pair";}
	return "null";
}


int main(){
	string str; vector<string> st; vector<int> card;
	while(cin >> str){
		st = split(str,',');
		for(int i=0;i<5;i++){
			stringstream ss; int a;
			ss << st[i];
			ss >> a;
			card.push_back(a);
		}
		sort(card.begin(),card.end());
		cout << poker(card) << endl;

		card.clear();
	}

}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;
string s[]={"one pair","two pair","three card","straight","null"};

int str(int n){
	cout << s[n] << endl;
	return 0;
}

int main(){
	int a[5], t[14], ans, m;
	while(scanf("%d,%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3],&a[4])){
		ans = -1, m = 0;
		sort(a, a+5);
		fill(t, t+14, 0);
		for(int i = 0;i < 5;i++){
			t[a[i]]++;
			if(m < t[a[i]])m = t[a[i]];
		}
		
		int flag = 0;
		if(a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13){str(3);continue;}
		for(int i = 1;i < 5 && a[i-1]+1 == a[i];i++)flag = i;
		if(flag == 4){str(3);continue;}
		
		if(m == 4){cout << "four card" << endl;continue;}
		if(m == 3){
			int f = 1;
			for(int i = 1;i <= 13;i++){
				if(t[i] == 2)f = 0;
			}
			if(!f){cout << "full house" << endl;continue;}
			ans = 2;
		}
		
		for(int i = 1;i <= 13;i++){
			if(!ans && t[i] == 2)ans = 1;
			if(ans != 1 && t[i] == 2)ans = 0;
		}
		if(ans == -1)ans = 4;
		str(ans);
	}
	return 0;
}

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

int main() {
  vector<int> a(5);
  string s[7] = {"null", "one pair", "two pair", "three card", "straight", "full house", "four card"};

  while (~scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3], &a[4])) {
    sort(a.begin(), a.end());
    int ans = 0;
    for (int i = 0; i < 4; ++i) {
      if (a[i] == a[i + 1]) {
        ans = 1;
        for (int j = i + 2; j < 5; ++j) {
          if (a[j] == a[j + 1]) ans = 2;
        }
        break;
      }
    }

    for (int i = 0; i < 3; ++i) {
      if (a[i] == a[i + 2]) ans = 3;
    }

    bool f = true;
    for (int i = 1; i < 5; ++i) {
      if (a[i] - 1 == a[i - 1]) continue;
      if (a[i - 1] == 1 && a[i] == 10) continue;
      f = false;
    }
    if (f) ans = 4;

    if (a[0] == a[1] && a[3] == a[4] && (a[1] == a[2] || a[2] == a[3])) ans = 5;

    if (a[0] == a[3] || a[1] == a[4]) ans = 6;

    cout << s[ans] << endl;
  }
}

C++: #include <iostream>

using namespace std;

void judge(int *cards){
    int i,j;
    int index[4] = {0};
    
    for(i = 1; i < 14; i++){
        if(cards[i] == 0){
            continue;
        }
        
        if(cards[i] == 4){
            cout<<"four card"<<endl;
            return;
        }
        else if(cards[i] == 1){
            for(j = i+1; j < 15; j++){
                if(cards[j] != 1){
                    break;
                }
            }
            if(j-i == 5){
                cout<<"straight"<<endl;
                return;
            }
        }
        else if(cards[i] == 2){
            index[2]++;
        }
        else{
            index[3]++;
        }
    }
    
    if(index[2] == 2){
        cout<<"two pair"<<endl;
        return;
    }
    
    if(index[3] == 1){
        if(index[2] == 1){
            cout<<"full house"<<endl;
        }else{
            cout<<"three card"<<endl;
        }
    }else{
        if(index[2] == 1){
            cout<<"one pair"<<endl;
        }else{
            cout<<"null"<<endl;
        }
    }
    return;
}

int main(void){
    int cards[15] = {0};
    int num,i,j;
    char c;
    
   while(cin>>num){
       if(num == 1){
           cards[14]++;
       }
       cards[num]++;
       
       for(i = 0; i < 4;i++){
            cin>>c>>num;
            if(num == 1){
                cards[14]++;
            }
            cards[num]++; 
       }
       
       judge(cards);
       
       for(i = 0; i < 15;i++){
            cards[i] = 0;
       }

   }
   
   return 0;
}