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[5];
	char kari;     
	while(1)     
	{         
		for(int i = 0;i < 5;i++)         
		{             
			if(scanf("%d",&card[i])== EOF) 
				goto kitune;             
				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++;  
				else if(check[i] == 3) three++;    
				else 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 if(three == 2) 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<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
#include<cmath>
#include<complex>
using namespace std;

typedef complex<double> P;

#define X real()
#define Y imag()


int main(){
    int mod=1000000007;
    int ax, ay;
    char f[12][12];
    int c[5];
    while (scanf("%d,%d,%d,%d,%d",&c[0],&c[1],&c[2],&c[3],&c[4])!=EOF) {
        vector<int> card(5);
        for (int i=0;i<5;++i) {
            card[i]=c[i];
        }
        sort(card.begin(),card.end());
        if ((card[1]==card[2] && card[2]==card[3]) && (card[0]==card[1] || card[4]==card[3])) printf("four card\n");
        else if ((card[0]==card[1] && card[3]==card[4]) && (card[2]==card[1] || card[2]==card[3])) printf("full house\n");
        else if (card[0]==card[1]-1 && card[1]==card[2]-1 && card[2]==card[3]-1 && card[3]==card[4]-1) printf("straight\n");
        else if (card[0]==1 && card[1]==10 && card[2]==11 && card[3]==12 && card[4]==13) printf("straight\n");
        else if ((card[0]==card[1] && card[1]==card[2]) || (card[1]==card[2] && card[2]==card[3]) && (card[2]==card[3] && card[3]==card[4])) printf("three card\n");
        else if ((card[0]==card[1] && (card[2]==card[3] || card[3]==card[4])) || (card[1]==card[2] && card[3]==card[4])) printf("two pair\n");
        else if (card[0]==card[1] || card[1]==card[2] || card[2]==card[3] || card[3]==card[4]) printf("one pair\n");
        else printf("null\b");
    }
    return 0;
}

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

using namespace std;

int main()
{
    const string out[] = {"null", "one pair", "two pair", 
                          "three card","straight",
                          "full house", "four card"};
    char ch;
    int input[6];

    while (cin >> input[0]) {
        // Input
        for (int i = 1; i < 5; i++) 
            cin >> ch >> input[i];
        input[5] = 100;

        // Initialization
        sort(input, input + 5);

        // Algorithm
        int card[5] = {0};
        int cnt = 0;
        
        for (int i = 0; i < 5; i++) {
            if (input[i] == input[i + 1])
                cnt++;
            else {
                card[cnt]++;
                cnt = 0;
            }
        }

        if (card[3] == 1) 
            cout << out[6] << endl;
        else if (card[1] == 1 && card[2] == 1) 
            cout << out[5] << endl;
        else if (card[2] == 1) 
            cout << out[3] << endl;
        else if (card[1] == 2)
            cout << out[2] << endl;
        else if (card[1] == 1)
            cout << out[1] << endl;
        else if (card[0] == 5) {
            int i;
            for (i = 1; i < 4; i++) 
                if (input[i + 1] != input[1] + i)
                    break;
            if (i == 4 && ((input[0] == input[1] - 1) || (input[0] == 1))) 
                cout << out[4] << endl;
            else 
                cout << out[0] << endl;
        }
    }

    return 0;
}