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<cmath>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<string>

using namespace std;


void Solution()
{
    // this problem can be solved by the way which can list up all situations case by case
    // all can be done like this way
    const string poker[] =
    { "null", "one pair", "two pair", "three card", "straight", "full house", "four card"};
    
    int a[5];
    char comma;
    
    while(cin>>a[0]>>comma>>a[1]>>comma>>a[2]>>comma>>a[3]>>comma>>a[4])
    {
        sort(a, a + 5);
        
        // Algorithm
        int pair[5] = {0};
        int count = 0;
        
        for (int i = 0; i < 5; i++)
        {
            if (a[i] == a[i + 1])
            {
                count++;
            }
            else
            {
                pair[count]++;
                count = 0;
            }
        }
        
        if (pair[3] == 1)
        {
            cout << poker[6] << endl;
        }
        else if (pair[1] == 1 && pair[2] == 1)
        {
            cout << poker[5] << endl;
        }
        else if (pair[2] == 1)
        {
            cout << poker[3] << endl;
        }
        else if (pair[1] == 2)
        {
            cout << poker[2] << endl;
        }
        else if (pair[1] == 1)
        {
            cout << poker[1] << endl;
        }
        else if (pair[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 << poker[4] << endl;
//            else
//                cout << poker[0] << endl;
            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<<poker[4]<<endl;
            }
            else
            {
                cout<<poker[0]<<endl;
            }
        }
        
    }
}

int main()
{
    Solution();
    return 0;
}

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

using namespace std;

int straight(int[]);

int main() {

	int ans, h[5];
	char s;

	while(1) {
		ans=0;
		cin >> h[0] >> s >> h[1 ]>> s >> h[2] >> s >> h[3] >> s >> h[4];
		sort(h, h+5);
		for(int i=0; i<4; i++) {
			for(int j=i+1; j<5; j++) {
				if(h[i]==h[j])
					ans++;
			}
		}
		switch(ans) {
			case 1:
				cout << "one pair" << endl;
				break;
			case 2:
				cout << "two pair" << endl;
				break;
			case 3:
				cout << "three cards" << endl;
				break;
			case 4:
				cout << "full house" << endl;
				break;
			case 6:
				cout << "four cards" << endl;
				break;
			default:
				if(straight(h))
					cout << "straight" << endl;
				else
					cout << "null" << endl;
		}
	}
	
	return 0;

}

int straight(int h[5]) {

	for(int i=0; i<9; i++) {
		if(h[4]=i+4&&h[3]==i+3&&h[2]==i+2&&h[1]==i+1&&h[0]==i||h[0]==1&&h[1]==10&&h[2]==11&&h[3]==12&&h[4]==13)
			return 1;
	}

	return 0;

}

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

int main(void) {
    int a[5];
    char c;
    while (cin >> a[0] >> c >> a[1] >> c >> a[2] >> c >> a[3] >> c >> a[4]) {
        int b[14] = {};
        for (int i = 0; i < 5; ++i) ++b[a[i]];
        sort(a, a+5);
        sort(b, b+14, greater<int>());


        if (b[0] == 4 || b[0] == 5)
            cout << "four card" << endl;
        else if (b[0] == 3 && b[1] == 2)
            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 (b[0] == 3)
            cout << "three card" << endl;
        else if (b[0] == 2 && b[1] == 2)
            cout << "two pair" << endl;
        else if (b[0] == 2 )
            cout << "one pair" << endl;
        else
            cout << "null" << endl;
    }
    return 0;
}

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

using namespace std;

bool isStraight(vector<int> v, int s) {
	for (int i = 1; i < v.size(); ++i) {
		if (v[(s+i)%v.size()] != (v[(s+i-1+v.size())%v.size()]+1)%13) {
			return false;
		}
	}
	return true;
}
bool isStraight(vector<int> v) {
	return isStraight(v, 0) || (v[0] == 0 && isStraight(v, 1));
}
int main() {
	vector<int> a(5);
	while ( scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3], &a[4]) != EOF ) {
		for (int i = 0; i < a.size(); ++i) {
			--a[i];
		}
		sort(a.begin(), a.end());
		vector<int> v(1, 1);
		int prev = a[0];
		for (int i = 1; i < a.size(); ++i) {
			if (prev == a[i]) {
				++v[v.size()-1];
			}
			else {
				v.push_back(1);
				prev = a[i];
			}
		}
		sort(v.begin(), v.end(), greater<int>());
		if (v[0] >= 4) {
			cout << "four card" << endl;
		}
		else if (v.size() >= 2 && v[0] >= 3 && v[1] >= 2) {
			cout << "full house" << endl;
		}
		else if ( isStraight(a) ) {
			cout << "straight" << endl;
		}
		else if (v[0] >= 3) {
			cout << "three card" << endl;
		}
		else if (v.size() >= 2 && v[1] >= 2) {
			cout << "two pair" << endl;
		}
		else if (v[0] >= 2) {
			cout << "one pair" << endl;
		}
		else {
			cout << "null" << endl;
		}
		
	}
}