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 <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

int main() {
    vector<int> v(5);
    char ch;
    while(cin>>v[0]>>ch>>v[1]>>ch>>v[2]>>ch>>v[3]>>ch>>v[4]) {
        sort(v.begin(), v.end());
        int n = 0;
        REP(i,4) {
            For(j,i+1,5) {
                if (v[i] == v[j]) n++;
            }
        }
        
        switch(n) {
            case 1:
                cout << "one pair" << endl;
                break;
            case 2:
                cout << "two pair" << endl;
                break;
            case 3:
                cout << "three card" << endl;
                break;
            case 4:
                cout << "full house" << endl;
                break;
            case 6:
                cout << "four card" << endl;
                break;
            default:
                if (v[0] == v[4]-4 || (v[0] == 1 && v[1] == 10)) {
                    cout << "straight" << endl;
                }else {
                    cout << "null" << endl;
                }
                break;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<ios>
#include<algorithm>
using namespace std;
int a[5];
main()
{
	while(~scanf("%d,%d,%d,%d,%d",a,a+1,a+2,a+3,a+4))
	{
		sort(a,a+5);
		if(a[1]==a[4]||a[0]==a[3])cout<<"four card"<<endl;
		else if(a[0]==a[1]&&a[2]==a[4]||a[0]==a[2]&&a[3]==a[4])cout<<"full house"<<endl;
		else if((a[0]+1==a[1]||a[0]+9==a[1])&&a[1]+1==a[2]&&a[2]+1==a[3]&&a[3]+1==a[4])
			cout<<"straight"<<endl;
		else if(a[0]==a[2]||a[1]==a[3]||a[2]==a[4])cout<<"three card"<<endl;
		else if(a[0]==a[1]&&(a[2]==a[3]||a[3]==a[4])||a[1]==a[2]&&a[3]==a[4])cout<<"two pair"<<endl;
		else if(a[0]==a[1]||a[1]==a[2]||a[2]==a[3]||a[3]==a[4])cout<<"one pair"<<endl;
		else cout<<"null"<<endl;
	}
}

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

using namespace std;
int a[5];
bool is_straight()
{
  for (int i = 1; i < 5; i++) {
    if (a[i] != a[i - 1] + 1) {
      goto next;
    }
  }
  return true;
 next:
  if (a[0] == 1 && a[1] == 10 && a[2] == 11 && a[3] == 12 && a[4] == 13) {
    return true;
  }
  return false;
}


int main()
{
  while (scanf("%d" , &a[0]) == 1) {
    for (int i = 1; i < 5; i++) {
      scanf(",%d", &a[i]);
    }
    sort(a, &a[5]);
    /*for (int i = 0; i < 5; i++) {
      printf("%d ", a[i]);
    }
    printf("\n");*/
    vector<int> mx_v;
    int mx = 1;
    for (int i = 1; i < 5; i++) {
      if (a[i] == a[i - 1]) {
	mx++;
      } else {
	mx_v.push_back(mx);
	mx = 1;
      }
    }
    mx_v.push_back(mx);
    mx = *max_element(mx_v.begin(), mx_v.end());
    //printf("mx = %d\n", mx);
    if (mx == 1) {
      if (is_straight()) {
	printf("straight\n");
	goto end;
      } else {
	printf("null\n");
	goto end;
      }
    } else if (mx == 2) {
      int c = 0;
      for (int i = 0; i < mx_v.size(); i++) {
	if (mx_v[i] == mx) {
	  c++;
	}
      }
      if (c == 2) {
	printf("two pair\n");
	goto end;
      } else {
	printf("one pair\n");
	goto end;
      }
    } else if (mx == 3) {
      for (int i = 0;  i< mx_v.size(); i++) {
	if (mx_v[i] == 2) {
	  printf("full house\n");
	  goto end;
	}
	printf("three card\n");
	goto end;
      }
    } else if (mx == 4 || mx == 5) {
      printf("four card\n");
      goto end;
    }
  end:;
  }
}

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;             
			if(i < 4)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 < 14;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<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
int main(){
	std::vector<int> cards(5);
	while(scanf("%d,%d,%d,%d,%d",&cards[0],&cards[1],&cards[2],&cards[3],&cards[4])!=EOF){
		int n=0;
		for(int i=0;i<4;i++){
			for(int j=i+1;j<5;j++){
				if(cards[i]==cards[j]){
					n++;
				}
			}
		}
		switch(n){
			case 1:
				std::cout<<"one pair"<<std::endl;
				break;

			case 2:
				std::cout<<"two pair"<<std::endl;
				break;

			case 3:
				std::cout<<"three card"<<std::endl;
				break;

			case 4:
				std::cout<<"full house"<<std::endl;
				break;

			case 6:
				std::cout<<"four card"<<std::endl;
				break;

			default:
				std::sort(cards.begin(),cards.end());
				if(cards[0]==cards[4]-4)std::cout<<"straight"<<std::endl;
				else if(cards[0]==1&&cards[1]==10&&cards[4]==13)std::cout<<"straight"<<std::endl;
				else std::cout<<"null"<<std::endl;
				break;
		}
	}
	return 0;
}