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>
#include <stdlib.h>
int compare_int (const void* a,const void* b) {

  return (*(int*)a-*(int*)b);

}

int main(void) {

  int hand[5];
  
  int overlap[5];
  int used[5];

  int count;
  int full_or_three=-1;
  int two_or_one=-1;
  int temp;
  int i,j,k,l,m=0;

  char c;

  while(scanf("%d,%d,%d,%d,%d",&hand[0],&hand[1],&hand[2],&hand[3],&hand[4])!=EOF) {

    //sort current hand
    qsort(hand,sizeof(hand)/sizeof(hand[0]),sizeof(int),compare_int);

    //for(i=0;i<5;i++) printf("%d ",hand[i]);
  
    //count overlapped cards
    count=0;

    for(i=0;i<5;i++) {

      overlap[i]=0;
      used[i]=0;
    }

    for(i=0;i<4;i++) {

      if(used[i]==1) continue;
    
      for(j=i+1;j<5;j++) {

	if(used[j]==0 && hand[i]==hand[j]) {

	  overlap[count]++;

	  used[i]=used[j]=1;

	}

      }

      used[i]=1;

      count++;

    }

    //for(i=0;i<5;i++) printf("%d ",overlap[i]);

    //check overlapped cards
  
    //four card?
    for(i=0;i<5;i++) {

      if(overlap[i]==3) {

	printf("four card\n");

	goto Terminate;
      
      }

    }

    //full house or three card?
    for(i=0;i<5;i++) {
    
      if(overlap[i]==2) {

	for(j=0;j<5;j++) {

	  if(overlap[j]==1) {

	    printf("full house\n");

	    goto Terminate;

	  }

	}

	printf("three card\n");

	goto Terminate;

      }

    }

    if(full_or_three==1) {

      for(i=0;i<5;i++) {

	if(overlap[i]==1) {

	  printf("full house\n");

	  goto Terminate;

	}

	else {

	  printf("three card\n");

	  goto Terminate;

	}

      }

    }

    //straight?
    if(hand[0]+1==hand[1] && hand[1]+1==hand[2] && hand[2]+1==hand[3] && hand[3]+1==hand[4] || (hand[0]==1 && hand[1]==10 && hand[2]==11 && hand[3]==12 && hand[4]==13)) {

      printf("straight\n");

      goto Terminate;

    }

    //two pair or one pair?
    for(i=0;i<4;i++) {

      if(overlap[i]==1) {

	for(j=i+1;j<5;j++) {

	  if(overlap[j]==1) {

	    printf("two pair\n");

	    goto Terminate;

	  }

	}

	printf("one pair\n");

	goto Terminate;

      }

    }

    //null
    printf("null\n");

  Terminate:
    continue;

  }

  return 0;

}

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

bool IsEqual(int* begin, int size)
{
	for (int i = 1; i < size; i++)
	{
		if (begin[i] != begin[i - 1]) return false;
	}
	return true;
}

int main()
{
	int card[5];

	while (true)
	{
		for (int i = 0; i < 5; i++)
		{
			if (scanf("%d,", &card[i]) == -1) return 0;
		}
		sort(card, card + 5);

		if	(IsEqual(card, 4)) printf("four card\n");

		else if (IsEqual(card + 1, 4)) printf("four card\n");

		else if (IsEqual(card, 3) && IsEqual(card + 3, 2)) printf("full house\n");

		else if (IsEqual(card, 2) && IsEqual(card + 2, 3)) printf("full house\n");

		else if (card[0] + 1 == card[1] && card[1] + 1 == card[2]
			  && card[2] + 1 == card[3] && card[3] + 1 == card[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 (IsEqual(card, 3) || IsEqual(card + 1, 3) || IsEqual(card + 2, 3)) printf("three card\n");

		else if (IsEqual(card, 2) && IsEqual(card + 2, 2)) printf("two pair\n");

		else if (IsEqual(card + 1, 2) && IsEqual(card + 3, 2)) printf("two pair\n");

		else
		{
			for (int i = 0; i < 4; i++)
			{
				if (IsEqual(card + i, 2))
				{
					printf("one pair\n");
					break;
				}
				if (i == 3)
				{
					printf("null\n");
				}
			}
		}
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void){

    int a[5];
    string str="null";
    while(scanf("%d,%d,%d,%d,%d",a[0],a[1],a[2],a[3],a[4])!=EOF){
        sort(a,a+5);
        if(((a[0]==a[1])&&(a[2]==a[3])&&(a[2]==a[1]))||((a[1]==a[2])&&(a[2]==a[3])&&(a[3]==a[4])))str="four card";
        else if(((a[0]==a[1])&&(a[1]==a[2])&&(a[3]==a[4]))||((a[0]==a[1])&&(a[2]==a[3])&&(a[3]==a[4])))str="full house";
        else if(((a[0]==1)&&(a[1]==10)&&(a[2]==11)&&(a[3]==12)&&(a[4]==13))||((a[0]+1==a[1])&&(a[1]+1==a[2])&&(a[2]+1==a[3])&&(a[3]+1==a[4])))str="straight";
        else if(((a[0]==a[1])&&(a[1]==a[2]))||((a[1]==a[2])&&(a[2]==a[3]))||((a[2]==a[3])&&(a[3]==a[4])))str="three card";
        else if(((a[0]==a[1])&&((a[2]==a[3])||(a[3]==a[4])))||((a[1]==a[2])&&(a[3]==a[4])))str="two pair";
        else if((a[0]==a[1])||(a[1]==a[2])||(a[2]==a[3])||(a[3]==a[4]))str="one pair";

        cout<<str<<endl;
    }
	return 0;
}

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

int main(){
	int card[5];
	
	while((scanf("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4])) != EOF){
		sort(card, card + 5);
		
		//four card
		if(card[2] == card[1] && card[2] == card[3] && (card[2] == card[0] || card[2] == card[4])){
			printf("four card\n");
		}
		//full house
		else if(card[0] == card[1] && card[3] == card[4] && (card[2] == card[1] || card[2] == card[3])){
			printf("full house\n");
		}
		//straight
		else if(((card[0] == 1)? 14 - card[1] : card[4] - card[0]) == 4){
			printf("straight\n");
		}
		//three card
		else if((card[0] == card[1] && card[1] == card[2]) || (card[1] == card[2] && card[2] == card[3]) || (card[2] == card[3] && card[3] == card[4])){
			printf("three card\n");
		}
		//two pair
		else if((card[0] == card[1] && (card[2] == card[3] || card[3] == card[4])) || (card[1] == card[2] && card[3] == card[4])){
			printf("two pair\n");
		}
		//one pair
		else if(card[0] == card[1] || card[1] == card[2] || card[2] == card[3] || card[3] == card[4]){
			printf("one pair\n");
		}
		//null
		else{
			printf("null\n");
		}
	}
	
	return 0;
}