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 <string>
#include <iostream>
#include <map>
#include <cstdio>

using namespace std;

int main(){
	int hand[5];

	while(~scanf("%d", &hand[0])){
		for(int i = 1; i < 5; i++){
			scanf(",%d", &hand[i]);
		}
		int num[17] = {0};

		for(int i = 0; i < 5; i ++){
			if(hand[i] == 1){
				hand[i] += 13;
			}
			num[hand[i]]++;
		}

		int h = 0;
		string s[] = {
			"four card",
			"full house",
			"straight",
			"three card",
			"two pair",
			"one pair",
			"null",
		};
		int seq = 0;

		for(int i = 2; i < 17; i++){
			if(num[i] == 2){
				if(h == 3){
					h = 5;
				}else{
					h++;
				}
			}
			else if(num[i] == 3){
				if(h == 1){
					h = 5;
				}else{
					h = 3;
				}
			}
			else if(num[i] == 4){
				h = 6;
			}
			else if(num[i-2]&num[i-1]&num[i]&num[i+1]&num[i+2]){
				h = 4;
			}
		}

		cout << s[h] << endl;
	}

	return 0;
}

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;
    } else {
      printf("null\n");
      goto end;
    }
  end:;
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

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

int card[5];

int c[13];

void solve(){
	memset(c,0,sizeof(c));
	REP(i,5){
		c[card[i]-1]++;
	}
	bool f1=false,f2=false;
	REP(i,13){
		if (c[i]>=4){
			f1=true;
		}
	}
	if (f1){
		cout<<"four card"<<endl;
		return;
	}
	REP(i,13){
		if (c[i]==3){
			f1=true;
		}else if (c[i]==2){
			f2=true;
		}
	}
	if (f1 && f2){
		cout<<"full house"<<endl;
		return;
	}
	f1=f2=false;
	REP(i,10){
		bool f=true;
		REP(j,5){
			if (c[(i+j)%13]!=1){
				f=false;
			}
		}
		if (f){
			f1=true;
		}
	}
	if (f1){
		cout<<"straight"<<endl;
		return;
	}
	REP(i,13){
		if (c[i]==3){
			f1=true;
		}
	}
	if (f1){
		cout<<"three card"<<endl;
		return;
	}
	int k=0;
	REP(i,13){
		if (c[i]==2){
			k++;
		}
	}
	if (k==2){
		cout<<"two pair"<<endl;
	}else if (k==1){
		cout<<"one pair"<<endl;
	}else{
		cout<<"null"<<endl;
	}
}

int main(){
	while (scanf("%d,%d,%d,%d,%d",card,card+1,card+2,card+3,card+4)){
		solve();
	}
	return 0;
}

C++: #include <stdio.h>

int main(void) {

  int hand[5];
  
  int rest[2];

  int flag;
  int temp;
  int i,j,k,l,m=0;

  char c;

  scanf("%d,%d,%d,%d,%d",&hand[0],&hand[1],&hand[2],&hand[3],&hand[4]);
  
  //ツ催渉可づ可ソツーツトツつオツづつッツづ篠・ツ・ツ・
  //four card?
  for(i=0;i<5;i++) {
    flag=1;
    for(j=0;j<5;j++) {
      for(k=0;k<5;k++) {
	if(j==i || k==i || j==k) continue;
	else if(hand[j]!=hand[k]) flag=0;
      }
    }
    if(flag==1) break;
  }

  if(flag==1) {
    printf("four card\n");
    return 0;
  }

  //either three card or full house?
  flag=0;

  for(i=0;i<3;i++) {
    for(j=i+1;j<4;j++) {
      for(k=j+1;k<5;k++) {
	if(hand[i]==hand[j] && hand[i]==hand[k]) {
	  flag=1;
	  goto Three;
	}
      }
    }
  }

  //judge three card or full house
 Three:
  if(flag==1) {
    for(l=0;l<5;l++) {
      if(l!=i && l!=j && l!=k) {
	rest[m]=hand[l];
	m++;
      }
    }

    if(rest[0]==rest[1]) {
      printf("full house\n");
      return 0;
    }

    else {
      printf("three card\n");
      return 0;
    }

  }

  //straight?
  for(i=0;i<4;i++) {
    for(j=i+1;j<5;j++) {
      if(hand[j]>hand[j+1]) {
	temp=hand[j];
	hand[j]=hand[j+1];
	hand[j+1]=hand[j];
      }
    }
  }
  //for(i=0;i<5;i++) printf("%d ",hand[i]);
  flag=1;

  for(i=0;i<4;i++) {
    if(hand[i]+1!=hand[i+1]) flag=0; 
  }

  if(flag==1) {
    printf("straight\n");
    return 0;
  }

  //two pair or one pair

  return 0;

}

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

int main(){
  vector<int> c(5);
  int ans;
  while(~scanf("%d,%d,%d,%d,%d", &c[0],&c[1],&c[2],&c[3],&c[4])) {
    sort(c.begin(), c.begin()+5);
    if(c[0] == c[3] || c[1] == c[4]) ans = 7;
    else if((c[0] == c[2] && c[3] == c[4])|| (c[0] == c[1] && c[2] == c[4])) ans = 6;
    else if(c[0] == c[4] - 4 && c[1] == c[3] - 2 && c[1] != c[2])
      ans = 5;
    else if(c[0] == 1 && c[1] == 10 && c[2] == 11 && c[3] == 12 && c[3] == 12)
      ans = 5;
    else if(c[0] == c[2] || c[1] == c[3] || c[2] == c[4])
      ans = 4;
    else if((c[0] == c[1] && c[2] == c[3]) || (c[1] == c[2] && c[3] == c[4]))
      ans = 3;
    else if(c[0] == c[1] || c[1] == c[2] || c[2] == c[3] || c[3] == c[4])
      ans = 2;
    else ans= 1;
    switch(ans) {
    case 1: cout << "null" << endl; break;
    case 2: cout << "one pair" << endl; break;
    case 3: cout << "two pair" << endl; break;
    case 4: cout << "three card" << endl; break;
    case 5: cout << "straight" << endl; break;
    case 6: cout << "full house" << endl; break;
    case 7: cout << "four card" << endl; break;
    }
  }
  return 0;
}