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 <vector>
#include <algorithm>
using namespace std;
/* null
 * one pair
 * two pair
 * three card
 * straight
 * full house
 * four card
 * */
int main() {
	vector<int> cards(5);
	while (scanf("%d%*c%d%*c%d%*c%d%*c%d",&cards[0],&cards[1],&cards[2],
				&cards[3],&cards[4])) {
		sort(cards.begin(), cards.end());
		vector<int> cnt(13, 0);
		for (int i=0; i<5; i++) cnt[cards[i]-1]++;
		int two = 0, three = 0, four = 0;
		for (int i=0; i<13; i++) {
			if (cnt[i] == 2) two++;
			if (cnt[i] == 3) three++;
			if (cnt[i] == 4) four++;
		}
		if (four == 1) {
			printf("four card\n");
			continue;
		} else if (two == 1 && three == 1) {
			printf("full house\n");
			continue;
		} else if (three == 1) {
			printf("three card\n");
			continue;
		} else if (two == 2) {
			printf("two pair\n");
			continue;
		} else if (two == 1) {
			printf("one pair\n");
			continue;
		}
		int c = 0;
		bool flag = false;
		for (int i=0; i<10; i++) {
			if (cnt[i] == 1) {
				c++;
				for (int j=1; j<5; j++) {
					int p = j + i;
					if (p == 13) p = 0;
//					printf("%d\n", p);
					if (cnt[p] == 1) c++;
				}
				if (c == 5) {
					flag = true;
					break;
				}
				c = 0;
			}
		}
		if (flag) {
			printf("straight\n");
		} else {
			printf("null\n");
		}
	}	
}

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

bool is_straight(int* cards) {
	for (int i = 0; i < 4; i++) {
		for(int j=0;j<4;j++){
			if (cards[j] > cards[j + 1]) {
				int tmp = cards[j];
				cards[j] = cards[j + 1];
				cards[j + 1] = tmp;
			}
		}
	}
	if (cards[0] == 1 && cards[1] == 10 && cards[2] == 11 && cards[3] == 12 && cards[4] == 13)return true;
	int tmp = cards[0];
	if (tmp + 1 == cards[1] && tmp + 2 == cards[2] && tmp + 3 == cards[3] && tmp + 4 == cards[4])return true;
	return false;
}
int main() {
	int cards[5];
	while (scanf("%d,%d,%d,%d,%d", &cards[0], &cards[1], &cards[2], &cards[3], &cards[4]) != EOF) {
		int same_cards1 = 0, same_cards2 = 4; int tmp;

		for (int i = 0; i < 5; i++) {
			tmp = 0;
			for (int j = 0; j < 5; j++) {
				if (cards[i] == cards[j])tmp++;
			}
			if (tmp > same_cards1)same_cards1 = tmp;
			if (tmp < same_cards2)same_cards2 = tmp;
		}
		if (same_cards1 == 4)cout << "four cards" << endl;
		else if (same_cards1 == 3 && same_cards2 == 2)cout << "full house" << endl;
		else if (is_straight(cards))cout << "straight" << endl;
		else if (same_cards1==3)cout << "three cards" << endl;
		else if (5-same_cards1-same_cards2==2)cout << "two pair" << endl;
		else if (same_cards1 == 2)cout << "one pair" << endl;
		else cout << "null" << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
#define same2(a,b) (c[a]==c[b])
#define same3(a,b,c) (same2(a,b)&&same2(b,c))
#define same4(a,b,c,d) (same3(a,b,c)&&same2(c,d))
int c[5];
bool four_card(){
if(same4(0,1,2,3)||same4(1,2,3,4)){
return 1;
}
return 0;
}
bool full_house(){
if((same3(0,1,2)&&same2(3,4)) || (same2(0,1)&&same3(2,3,4))){
return 1;
}else{
return 0;
}
}
bool straight(){
bool res=1;
for(int i=0;i<4;i++){
if((c[i]+1)!=c[i+1])res=0;
}
if((res==0) && (c[0]==1) && (c[1]==10)){
res=1;
for(int i=1;i<4;i++){
if((c[i]+1)!=c[i+1])res=0;
}
}
return res;
}
bool three_card(){
if(same3(0,1,2)||same3(1,2,3)||same3(2,3,4)){
return 1;
}else{
return 0;
}
}
bool two_pair(){
int p=0;
for(int i=0;i<4;i++){
if(same2(i,i+1)){
p++;
}
}
if(p==2){
return 1;
}else{
return 0;
}
}
bool one_pair(){
if(same2(0,1)||same2(1,2)||same2(2,3)||same2(3,4)){
return 1;
}else{
return 0;
}
}
int main(){
while(scanf("%d,%d,%d,%d,%d",&c[0],&c[1],&c[2],&c[3],&c[4])!=EOF){
sort(c,c+5);
if(four_card()){
cout<<"four card"<<endl;
}else if(full_house()){
cout<<"full house"<<endl;
}else if(straight()){
cout<<"straight"<<endl;
}else if(three_card()){
cout<<"three card"<<endl;
}else if(two_pair()){
cout<<"two pair"<<endl;
}else if(one_pair()){
cout<<"one pair"<<endl;
}else{
cout<<"null"<<endl;
}
}
}

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

int main(){
  vector<int> c(5);
  int ans;
  while(~scanf("%d,%d,%d,%d,%d", &c[0],&c[1],&c[2],&c[3],&c[4])) {
    sort(c.begin(), c.begin()+5);
    if(c[0] == c[3] || c[1] == c[4]) ans = 7;
    else if((c[0] == c[2] && c[3] == c[4])|| (c[0] == c[1] && c[2] == c[4])) ans = 6;
    else if(c[0] + 1 == c[1] && c[1] + 1 == c[2] && c[2] + 1 == c[3] && c[3] +1 == c[4])
      ans = 5;
    else if(c[0] == 1 && c[1] == 10 && c[2] == 11 && c[3] == 12 && c[4] == 13)
      ans = 5;
    else if(c[0] == c[2] || c[1] == c[3] || c[2] == c[4])
      ans = 4;
    else if((c[0] == c[1] && c[2] == c[3]) || (c[0] == c[1] && c[3] == c[4]) || (c[1] == c[2] && c[3] == c[4]))
      ans = 3;
    else if(c[0] == c[1] || c[1] == c[2] || c[2] == c[3] || c[3] == c[4])
      ans = 2;
    else ans= 1;
    switch(ans) {
    case 1: cout << "null" << endl; break;
    case 2: cout << "one pair" << endl; break;
    case 3: cout << "two pair" << endl; break;
    case 4: cout << "three card" << endl; break;
    case 5: cout << "straight" << endl; break;
    case 6: cout << "full house" << endl; break;
    case 7: cout << "four card" << endl; break;
    }
  }
  return 0;
}