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(){
    int card[5];
    
    while(scanf("%d" ,&card[0])!=EOF){
        for(int i = 1 ; i < 5 ; i++){
            scanf(",%d" ,&card[i]);
        }
        
        int cnt = 0;
        for(int i = 0 ; i < 5 ; i++){
            for(int j = 0 ; j < 5 ; j++){
                if(card[i] == card[j] && i != j) cnt++;
                
            }
        }
        
        int flg = 0;
        switch(cnt){
            case 2:
                printf("one pair\n");
                flg = 2;
                break;
            case 4:
                printf("two pair\n");
                flg = 2;
                break;
            case 6:
                printf("three card\n");
                flg = 2;
                break;
            case 8:
                printf("full house\n");
                flg = 2;
            case 12:
                printf("four card\n");
                flg = 2;
                break;
            default:
                flg = 1;
        }
        
        if(flg == 2) continue;
        
        int ct=0;
        if(flg){
            sort(card,card+5);
            for(int i = 1 ; i < 5 ; i++){
                if(card[i]-card[i-1]==1) ct++;
            }
        }
        
        if(ct==4) printf("straight\n");
        else if(card[0]==1&&card[1]==10&&card[2]==11&&card[3]==12&&card[4]==13) printf("straight\n");
        else printf("null\n");
    }

    return 0;
}

C++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            string s;
            while ((s = Console.ReadLine()) != null)
            {
                var list = s.Split(',').Select(int.Parse).ToList();
                list.Sort();
                var dict = new Dictionary<int, int>();
                foreach (var v in list)
                {
                    if (dict.ContainsKey(v))
                    {
                        var i = dict[v] + 1;
                        dict.Remove(v); dict.Add(v, i);
                    }
                    else
                    {
                        dict.Add(v, 1);
                    }
                }
                bool isStraight = true;
                for (int i = list[0]; i < list[0] + 5; i++)
                {
                    if (list[i - list[0]] != i) { isStraight = false; break; }
                }
                if (list[0] == 1)
                {
                    isStraight = true;
                    for (int i = 0; i < 4; i++)
                    {
                        if (list[i+1] != 10+i) { isStraight = false; break; }
                    }
                }

                bool isFour = false;
                bool isThree = false;
                int Pairs = 0;

                var lk = dict.Keys;
                foreach (var v in lk)
                {
                    isFour |= dict[v] == 4;
                    isThree |= dict[v] == 3;
                    Pairs += dict[v] == 2 ? 1 : 0;
                }

                string result = "null";

                if (isFour) result = "four card";
                else if (isThree && Pairs > 0) result = "full house";
                else if (isStraight) result = "straight";
                else if (isThree) result = "three card";
                else if (Pairs == 2) result = "two pairs";
                else if (Pairs > 0) result = "one pair";

                Console.WriteLine(result);
            }
        }
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
string m[7]={"null","one pair","two pair","three card","straight","full house","four card"};
int c[5],ans;
bool s1(){
	bool ok=false;
	for(int i=0;i<4;i++){
		if(c[i]==c[i+1])ok=true;
	}
	return ok;
}
bool s2(){
	bool ok=false;
	if(c[1]==c[2]&&c[3]==c[4])ok=true;
	if(c[0]==c[1]&&c[3]==c[4])ok=true;
	if(c[0]==c[1]&&c[2]==c[3])ok=true;
	return ok;
}
bool s3(){
	bool ok=false;
	for(int i=0;i<3;i++){
		if(c[i]==c[i+1]&&c[i]==c[i+2])ok=true;
	}
	return ok;
}
bool s4(){
	bool ok=true;
	for(int i=0;i<4;i++){
		if(c[i]+1!=c[i+1])ok=false;
	}
	int d[5]={1,10,11,12,13};
	bool A=true;
	for(int i=0;i<5;i++){
		if(c[i]!=d[i])A=false;
	}
	if(A)ok=true;
	return ok;
}
bool s5(){
	bool ok=true;
	if(c[0]!=c[1]||c[3]!=c[4])ok=false;
	if(c[1]!=c[2]&&c[3]!=c[2])ok=false;
	return ok;
}
bool s6(){
	bool ok=false;
	if(c[0]==c[1]&&c[0]==c[2]&&c[0]==c[3])ok=true;
	if(c[4]==c[1]&&c[4]==c[2]&&c[4]==c[3])ok=true;
	return ok;
}
int main(){
	char z;
	while(cin>>c[0]){
		for(int i=1;i<5;i++)cin>>z>>c[i];
		ans=0;
		sort(c,c+5);
		if(s1())ans=1;
		if(s2())ans=2;
		if(s3())ans=3;
		if(s4())ans=4;
		if(s5())ans=5;
		if(s6())ans=6;
		cout<<m[ans]<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<queue>
#include<math.h>
#include<string>
#include<stack>
#include<typeinfo>
using namespace std;
typedef pair<int, int> P;
int main() {
	char ch, straight, four, three, twop, onep;
	int check[5] = { 1,10,11,12,13 }, st = 0;
	int card[5];	while (cin >> card[0] >> ch >> card[1] >> ch >> card[2] >> ch >> card[3] >> ch >> card[4]) {
		int cnt[14] = { 0 };
		sort(card, card + 5);
		four = false;
		three = false;
		twop = false;
		onep = false;
		straight = true;
		st = 0;
		for (int i = 0; i < 5; ++i) {
			if (i != 0 && card[i - 1] + 1 != card[i])straight = false;
			if (card[i] == check[i])st++;
			cnt[card[i]]++;
		}
		if (st == 5)straight = true;
		for (int i = 0; i < 5; ++i) {
			if (i != 0 && card[i - 1] == card[i])continue;
			if (cnt[card[i]] == 4) {
				four = true;
				break;
			}
			else if (cnt[card[i]] == 3) three = true;
			else if (cnt[card[i]] == 2 && onep)twop = true;
			else if (cnt[card[i]] == 2)onep = true;
		}

		if (four)cout << "four card" << endl;
		else if (onep&&three)cout << "full house" << endl;
		else if (straight)cout << "straight" << endl;
		else if (three)cout << "three card" << endl;
		else if (twop)cout << "two pair" << endl;
		else if (onep)cout << "one pair" << endl;
		else cout << "null" << endl;


	}
	return 0;
}