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 <functional>
using namespace std;

int nPair(int *card);
bool isThreeCard(int *card);
bool isStraight(int *card);
bool isFullHouse(int *card);
bool isFourCard(int *card);

int main()
{
	int card[5] = {0};
	char c;

	while (cin >> card[0])
	{
		if (cin.eof()) break;
		cin >> c >> card[1] >> c >> card[2] >> c >> card[3] >> c >> card[4];

		if (isFourCard(card))
			cout << "four card" << endl;
		else if (isFullHouse(card))
			cout << "full house" << endl;
		else if (isStraight(card))
			cout << "straight" << endl;
		else if (isThreeCard(card))
			cout << "three card" << endl;
		else if (nPair(card) == 2)
			cout << "two pair" << endl;
		else if (nPair(card) == 1)
			cout << "one pair" << endl;
		else
			cout << "null" << endl;
	}
	return 0;
}

int nPair(int *card)
{
	int c[13] = {0}, i, n = 0;

	for (i = 0; i < 5; i++)
		c[card[i] - 1]++;

	sort(c, c+13, greater<int>());

	for (i = 0; i < 5; i++)
		if (c[i] == 2)
			n++;
	return n;
}

bool isThreeCard(int *card)
{
	int c[13] = {0}, i;

	for (i = 0; i < 5; i++)
		c[card[i] - 1]++;

	sort(c, c+13, greater<int>());

	for (i = 0; i < 5; i++)
	{
		if (c[i] == 3)
			return true;
	}
	return false;
}

bool isFourCard(int *card)
{
	int c[13] = {0}, i;

	for (i = 0; i < 5; i++)
		c[card[i] - 1]++;

	sort(c, c+13, greater<int>());

	for (i = 0; i < 5; i++)
	{
		if (c[i] == 4)
			return true;
	}
	return false;
}

bool isStraight(int *card)
{
	int c[13] = {0}, i, j;
	bool b;

	for (i = 0; i < 5; i++)
		c[card[i] - 1]++;

	if (c[1] == 1 && c[12] == 1)
		return false;

	sort(c, c+13, greater<int>());
	
	for (i = 0; i < 5; i++)
	{
		if (c[i] == 1)
			b = true;
		else
			b = false;
	}
	if (b == true)
		return true;
	return false;
}

bool isFullHouse(int *card)
{
	int c[13] = {0}, i;

	for (i = 0; i < 5; i++)
		c[card[i] - 1]++;

	sort(c, c+13, greater<int>());
	
	if (c[0] == 3 && c[1] == 2)
		return true;
	else
		return false;
}

C++: #include <stdio.h>
#include <algorithm.h>

using namespace std;

int main(void)
{
	int card[5];
	int c1;
	int c2;
	int straight;
	int i;
	int j;
	char conma;
	
	while (scanf("%d", &card[0]) != EOF){
		for (i = 1; i < 5; i++){
			scanf("%c %d", &conma, &card[i]);
		}
		sort(card, card + 5);
		
		c1 = 0;
		c2 = 0;
		straight = 0;
		
		for (i = 0; i < 4; i++){
			if (card[i] + 1 == card[i + 1]){
				straight++;
			}
			if (card[i] == card[i + 1] && card[i] == card[0]){
				c1++;
			}
			else if (card[i]  == card[i + 1] && card[i] != card[0]){
				c2++;
			}
		}
		
		if ((c1 == 1 && c2 == 0) || (c1 == 0 && c2 == 1)){
			printf("one pair\n");
		}
		else if (c1 == 1 && c1 == c2){
			printf("two pair\n");
		}
		else if (c1 + c2 == 3 && c1 != 0 && c2 != 0){
			printf("full house\n");
		}
			
		else if (c1 == 2 || c2 == 2){
			printf("three card\n");
		}
		else if (straight == 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 if (c1 == 3 || c2 == 3){
			printf("four card\n");
		}
		else {
			printf("null\n");
		}
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <algorithm.h>

using namespace std;

int main(void)
{
	int card[5];
	int count1;
	int count2;
	int straight;
	int i;
	int j;
	char conma;
	
	while (scanf("%d", &card[0]) != EOF){
		for (i = 1; i < 5; i++){
			scanf("%c %d", &conma, &card[i]);
		}
		sort(card, card + 5);
		
		count1 = 0;
		count2 = 0;
		straight = 0;
		
		for (i = 0; i < 4; i++){
			if (card[i] + 1 == card[i + 1]){
				straight++;
			}
			if (card[i] == card[i + 1] && card[i] == card[0]){
				count1++;
			}
			else if (card[i]  == card[i + 1] && card[i] != card[0]){
				count2++;
			}
		}
		
		if ((count1 == 1 && count2 == 0) || (count1 == 0 && count2 == 1)){
			printf("one pair\n");
		}
		else if (count1 == 1 && count1 == count2){
			printf("two pair\n");
		}
		else if (count1 + count2 == 3 && count1 != 0 && count2 != 0){
			printf("full house\n");
		}
			
		else if (count1 == 2 || count2 == 2){
			printf("three card\n");
		}
		else if (straight == 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 if (count1 == 3 || count2 == 3){
			printf("four card\n");
		}
		else {
			printf("null\n");
		}
	}
	
	return 0;
}

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




int main(){
  int c[6];

  while(scanf("%d,%d,%d,%d,%d",&c[0],&c[1],&c[2],&c[3],&c[4])!=EOF){
    map<int,int> card;
    int mex = 0;
    for(int i=0;i<5;i++){
      card[c[i]]++;
      mex = max(mex,card[c[i]]);
    }
    sort(c,c+5);
    bool full = true;
    bool A,B;
    A = B = false;
    for(int i=0;i<5;i++){
      if(c[i] == 13)A = true;
      if(c[i] == 1)B = true;
    }
    if(A && B){
      for(int i=0;i<5;i++){
	if(c[i] == 1){
	  c[i] = 14;
	  break;
	}
      }
      sort(c,c+5);
   
    }
    for(int i=0;i<4;i++){
      if(c[i]+1 != c[i+1]){
	full = false;
	break;
      }
    }


    if(mex == 4){
      cout << "four card" << endl;
    }
    else if(mex == 3 && card.size() == 2){
      cout << "full house" << endl;
    }
    else if(full){
      cout << "straight" << endl;
    }
    else if(mex == 3){
      cout << "three card" << endl;
    }
    else if(card.size() == 3){
      cout << "two pair" << endl;
    }
    else if(mex == 2){
      cout << "one pair" << endl;
    }
    else cout << "null" << endl;


  }
  return 0;
}