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 <stdio.h>

#define ACE 14
int is4card(int cnt[]);
int isFullHouse(int cnt[]);
int isStraight(int cnt[]);
int is3card(int cnt[]);
int is2pair(int cnt[]);
int is1pair(int cnt[]);

int main(void){
    int c[5];
    int count[ACE+1];
    
    while (scanf("%d,%d,%d,%d,%d", c+0, c+1, c+2, c+3, c+4) != EOF){
        for (int i=2; i<=ACE; i++) count[i]=0;
        for (int i=0; i<5; i++){
            if (c[i]==1) c[i]=ACE;
            count[c[i]]++;
        }
        
        if (is4card(count)) printf("four card\n");
        else if (isFullHouse(count)) printf("full house\n");
        else if (isStraight(count)) printf("straight\n");
        else if (is3card(count)) printf("three card\n");
        else if (is2pair(count)) printf("two pair\n");
        else if (is1pair(count)) printf("one pair\n");
        else printf("null\n");
    }
    return 0;
}

int is4card(int cnt[]){
    for (int i=2; i<=ACE; i++){
        if (cnt[i] == 4) return 1;
    }
    return 0;
}

int isFullHouse(int cnt[]){
    return is3card(cnt) && is1pair(cnt);
}

int isStraight(int cnt[]){
    int len;
    
    for (int i=2; i<=ACE; i++){
        if (cnt[i]==0) len=0;
        else {
            len++;
            if (len==5) return 1;
        }
    }
    return 0;
}

int is3card(int cnt[]){
    for (int i=2; i<=ACE; i++){
        if (cnt[i] == 3) return 1;
    }
    return 0;
}

int is2pair(int cnt[]){
    int i,j;
    // find the first pair
    for (i=2; i<=ACE; i++){
        if (cnt[i] == 2) break;
    }
    if (i>ACE) return 0;
    // find second pair
    for (j=2; j<=ACE; j++){
        if (i==j) continue;
        if (cnt[j] == 2) return 1;
    }
    return 0;
}

int is1pair(int cnt[]){
    for (int i=2; i<=ACE; i++){
        if (cnt[i] == 2) return 1;
    }
    return 0;
}

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

class Hand
{
  public:
    Hand(vector<int> cards);

  public:
    string what_hand();

  private:
    bool is_one_pair();
    bool is_two_pair();
    bool is_three_card();
    bool is_straight();
    bool is_full_house();
    bool is_four_card();

  private:
    vector<int> m_hand;
};

Hand::Hand(vector<int> cards) :
  m_hand(5)
{
  for (int i = 0; i < 5; ++i)
  {
    m_hand[i] = cards[i];
  }
  sort(m_hand.begin(), m_hand.end());
}

string Hand::what_hand()
{
  if (is_four_card())
  {
    return "four card";
  }
  else if (is_full_house())
  {
    return "full house";
  }
  else if (is_straight())
  {
    return "straight";
  }
  else if (is_three_card())
  {
    return "three card";
  }
  else if (is_two_pair())
  {
    return "two pair";
  }
  else if (is_one_pair())
  {
    return "one pair";
  }
  else
  {
    return "null";
  }
}

bool Hand::is_one_pair()
{
  int prev = -1;
  for (int card : m_hand)
  {
    if (prev == -1)
    {
      prev = card;
      continue;
    }
    if (prev == card) return true;
    prev = card;
  }
  return false;
}

bool Hand::is_two_pair()
{
  if ((m_hand[0] == m_hand[1] and m_hand[2] == m_hand[3]) or
      (m_hand[0] == m_hand[1] and m_hand[3] == m_hand[4]) or
      (m_hand[1] == m_hand[2] and m_hand[3] == m_hand[4]) )
  {
    return true;
  }
  else
  {
  return false;
  }
}

bool Hand::is_three_card()
{
  for (int i = 0; i < 3; ++i)
  {
    if (m_hand[i] == m_hand[i+1] and m_hand[i] == m_hand[i+2])
    {
      return true;
    }
  }
  return false;
}

bool Hand::is_straight()
{
  if (m_hand[0] == 1 and m_hand[1] == 10 and m_hand[2] == 11 and 
      m_hand[3] == 12 and m_hand[4] == 13)
  {
    return true;
  }

  int prev = -1;
  for (int card : m_hand)
  {
    if (prev == -1)
    {
      prev = card;
      continue;
    }
    if (prev + 1 != card)
    {
      return false;
    }
    prev = card;
  }
  return true;
}

bool Hand::is_full_house()
{
  if ((m_hand[0] == m_hand[1] and m_hand[0] == m_hand[2] and
       m_hand[3] == m_hand[4]) or
      (m_hand[2] == m_hand[3] and m_hand[2] == m_hand[4] and
       m_hand[0] == m_hand[1]) )
  {
    return true;
  }
  else
  {
    return false;
  }
}

bool Hand::is_four_card()
{
  if ((m_hand[0] == m_hand[1] and m_hand[0] == m_hand[2] and m_hand[0] == m_hand[3]) or
      (m_hand[1] == m_hand[2] and m_hand[1] == m_hand[3] and m_hand[1] == m_hand[4]) )
  {
    return true;
  }
  else
  {
    return false;
  }
}

int main(void)
{
  cin >> noskipws;
  while (true)
  {
    vector<int> cards(5);
    char buf_ch;
    for (int& card : cards)
    {
      cin >> card;
      cin >> buf_ch;
    }
    if (cin.eof() ) break;

    Hand hand(cards);
    cout << hand.what_hand() << endl;
  }
  return 0;
}

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

int main() {
	int ar[5];
	while (scanf("%d,%d,%d,%d,%d", &ar[0], &ar[1], &ar[2], &ar[3], &ar[4])+1) {
		sort(ar, ar + 5);
		int a = ar[0];
		int b = ar[1];
		int c = ar[2];
		int d = ar[3];
		int e = ar[4];

		if (a == d || b == e) { cout << "four card" << endl; }
		else if (a == c && d == e) { cout << "full house" << endl; }
		else if (a == b && c == e) { cout << "full house" << endl; }
		else if (b - a == 1 && c - b == 1 && d - c == 1 && e - d == 1) { cout << "straight" << endl; }
		else if (a == 1 && b == 10 && c == 11 && d == 12 && e == 13) { cout << "straight" << endl; }
		else if (a == c || b == d || c == e) { cout << "three card" << endl; }
		else if (a==b&&c==d) { cout << "two pair" << endl; }
		else if (a == b&&d == e) { cout << "two pair" << endl; }
		else if (b == c&&d == e) { cout << "two pair" << endl; }
		else if (a == b || b == c || c == d || d == e) { cout << "one pair" << endl; }
		else { cout << "null" << endl; }
	}
	return 0;
}