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 <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#define INF 1000000000
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define all(x) (x).begin(),x.end()
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

int c[6];

void tranp_sort(){
  for(int i=0;i<5;i++){
    if(c[i]==1)c[i]+=13;
  }
  sort(c,c+5);
  for(int i=0;i<5;i++){
    if(c[i]==14)c[i]=1;
  }
}

void input(){  
  getchar();cin>>c[1];
  getchar();cin>>c[2];
  getchar();cin>>c[3];
  getchar();cin>>c[4];
}


bool one_pair(){
  for(int i=1;i<5;i++){
    if(c[i]==c[i-1])return true;
  }
  return false;
}

bool two_pair(){
  int cnt=0;
  map<int,int>m;
  for(int i=0;i<5;i++)m[c[i]]++;
  for(int i=1;i<=13;i++){
    if(m[i]==2)cnt++;
  }
  if(cnt==2)return true;
  else return false;
}

bool three_card(){
  for(int i=2;i<5;i++){
    if(c[i]==c[i-1]&&c[i-1]==c[i-2])return true;
  }
  return false;
}

bool four_card(){
  for(int i=3;i<5;i++){
    if(c[i]==c[i-1]&&c[i-1]==c[i-2]&&c[i-2]==c[i-3])return true;
  }
  return false;
}

bool fullhouse(){
  bool a,b;
  a=b=false;
  map<int,int>m;
  for(int i=0;i<5;i++)m[c[i]]++;
  for(int i=1;i<=13;i++){
    if(m[i]==3)a=true;
    if(m[i]==2)b=true;
  }
  if(a==true&&b==true)return true;
  else return false;
}

bool straight(){
  int tmp=c[0];
  for(int i=0;i<5;i++){
    if(c[i]==1)tmp++;
    //cout<<c[i]<<" = "<<(tmp+i)%14<<endl;
    if((tmp+i)%14!=c[i])return false;
  }
  return true;
}

int main(){

  while(cin>>c[0]){
    input();
    tranp_sort();
    if(four_card())cout<<"four card"<<endl;
    else if(fullhouse())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;
  }
  return 0;
}

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

using namespace std;

int one_pair(int hand[])
{
	int i, j;
	
	for (i = 0; i < 5 - 1; i++){
		for (j = i + 1; j < 5; j++){
			if (hand[i] == hand[j]){
				return (1);
			}
		}
	}
	
	return (0);
}

int two_pair(int hand[])
{
	int i, j, k, pair[2];
	
	for (k = 0; k < 2; k++){
		for (i = 0; i < 5 - 1; i++){
			for (j = i + 1; j < 5; j++){
				if (hand[i] == hand[j] && i != pair[0] && i != pair[1] && j != pair[0] && j != pair[1]){
					pair[0] = i;
					pair[1] = j;
					
					if (k == 1){
						return (1);
					}
				}
			}
		}
	}
	
	return (0);
}

int three_card(int hand[]){
	int i, j, k;
	
	for (i = 0; i < 5 - 2; i++){
		for (j = i + 1; j < 5 - 1; j++){
			for (k = j + 1; k < 5; k++){
				if (hand[i] == hand[j] && hand[j] == hand[k]){
					return (1);
				}
			}
		}
	}
	
	return (0);
}

int straight(int hand[]){
	int i, j, hand1[5], hand2[5];
	
	for (i = 0; i < 5; i++){
		hand1[i] = hand[i];
	}
	
	for (i = 0; i < 5; i++){
		hand2[i] = hand[i];
		if (hand2[i] == 1){
			hand2[i] = 14;
		}
	}
	
	sort(hand1, hand1 + 5);
	sort(hand2, hand2 + 5);
	
	for (i = 0; i < 5 - 1; i++){
		if (hand1[i] != hand1[i + 1] - 1){
			break;
		}
	}
	
	if (i == 5 - 1){
		return (1);
	}
	
	for (i = 0; i < 5 - 1; i++){
		if (hand2[i] != hand2[i + 1] - 1){
			break;
		}
	}
	
	if (i == 5 - 1){
		return (1);
	}
	
	return (0);
}

int full_house(int hand[])
{
	int i, j, k, l, m, hand1[5];
	
	for (i = 0; i < 5; i++){
		hand1[i] = hand[i];
	}
	
	for (i = 0; i < 5 - 2; i++){
		for (j = i + 1; j < 5 - 1; j++){
			for (k = j + 1; k < 5; k++){
				if (hand1[i] == hand1[j] && hand1[j] == hand1[k]){
					hand1[i] = -1;
					hand1[j] = -2;
					hand1[k] = -3;
					for (l = 0; l < 5 - 1; l++){
						for (m = l + 1; m < 5; m++){
							if (hand1[l] == hand1[m]){
								return (1);
							}
						}
					}
				}
			}
		}
	}
	
	return (0);
}

int four_card(int hand[]){
	int i, j, k, l;
	
	for (i = 0; i < 5 - 3; i++){
		for (j = i + 1; j < 5 - 2; j++){
			for (k = j + 1; k < 5 - 1; k++){
				for (l = k + 1; l < 5; l++){
					if (hand[i] == hand[j] && hand[j] == hand[k] && hand[k] == hand[l]){
						return (1);
					}
				}
			}
		}
	}
	
	return (0);
}

void poker_hand(int hand[]){
	if (four_card(hand)) puts("four card");
	else if (full_house(hand)) puts("full house");
	else if (straight(hand)) puts("straight");
	else if (three_card(hand)) puts("three card");
	else if (two_pair(hand)) puts("two pair");
	else if (one_pair(hand)) puts("one pair");
	else puts("null");
}

int main()
{
	int hand[5];
	
	while (scanf("%d,%d,%d,%d,%d", &hand[0], &hand[1], &hand[2], &hand[3], &hand[4]) != EOF){
		poker_hand(hand);
	}
	
	return (0);
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#define foreach(r,p) for(r::iterator it=p.begin();it!=p.end();++it)
using namespace std;

string check(vector<int> s)
{
    if( (s[0]==s[1]&&s[0]==s[2]&&s[0]==s[3])|| (s[1]==s[2]&&s[1]==s[3]&&s[1]==s[4]))
        return "four card";

    if((s[0]==s[1]&&s[0]==s[2]&&s[3]==s[4])||(s[0]==s[1]&&s[2]==s[3]&&s[2]==s[4]))
        return "full house";
    
    if((s[0]==(s[1]-1) &&s[0]==(s[2]-2) && s[0] ==(s[3]-3) && s[0]==(s[4]-4))
            ||(s[0]==1 && s[1]==10 &&s[2]==11&&s[3]==12&&s[4]==13))
        return "straight";
    if((s[0]==s[1]&&s[0]==s[2])||(s[1]==s[2]&&s[1]==s[3]) || (s[2]==s[3]&&s[2]==s[4]))
        return "three card";
    
    if((s[0]==s[1]&&s[2]==s[3])||(s[0]==s[1]&&s[3]==s[4])||(s[1]==s[2]&&s[3]==s[4]))
        return "two pair";
    
    if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]||s[3]==s[4])
        return "one pair";

    return "null";
}


int main()
{
    int n[5];
    char t;
    while( cin >>n[0]>>t>>n[1]>>t>>n[2]>>t>>n[3]>>t>>n[4])
    {
        vector<int> card;
        if(cin.eof()) break;
        for(int i=0;i<5;i++)
        {
            card.push_back(n[i]);
        }
        sort(card.begin(),card.end());
        cout << check(card) << endl;
    }
    return 0;
}