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<string>
#include<sstream>
#include<vector>
#include<algorithm>
using namespace std;
bool st(vector<int> v){
  if(
     v[1]+1==v[2]&&
     v[2]+1==v[3]&&
     v[3]+1==v[4]){
    if(v[0]+1==v[1]) return true;
    if(v[0]==1&&v[4]==13) return true;
  }
  return false;
}
int main(){
  string buf;
  int i,j,k;
  while(cin >> buf){
    vector<int> v,p;
    for(i=0;i<buf.size();i++) if(buf[i]==',') buf[i]=' ';
    stringstream ss(buf);
    for(i=0;i<5;i++){
      ss >> k;
      v.push_back(k);
    }
    sort(v.begin(),v.end());
    k=1;
    for(i=1;i<5;i++){
      //cout << v[i] << endl;
      if(v[i-1]==v[i]) k++;
      else {
	p.push_back(k);
	k=1;
      }
    }
    if(k!=1) p.push_back(k);
    sort(p.begin(),p.end(),greater<int>());
    //for(i=0;i<p.size();i++) cout << p[i] << endl;
    if(p[0]==4) cout << "four card" << endl;
    else if(p[0]==3&&p[1]==2) cout << "full house" << endl;
    else if(p[0]==3) cout << "three card" << endl;
    else if(p[0]==2&&p[1]==2) cout << "two pair" << endl;
    else if(p[0]==2) cout << "one pair" << endl;
    else if(st(v)) cout << "straight" << endl;
    else cout << "null" << endl;
  }

}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int a[5];

bool four_card() {
  if (a[0] == a[1]) {
    return a[1] == a[2] && a[2] == a[3];
  } else {
    return a[1] == a[2] && a[2] == a[3] && a[3] == a[4];
  }
}

bool straight() {
  if (a[0] == 1 && a[1] == 10 && a[2] == 11 && a[3] == 12 && a[4] == 13)
    return true;
  for (int i = 0; i < 4; i++)
    if (a[i] != a[i+1] - 1)
      return false;
  return true;
}

bool full_house() {
  int b = a[0];
  int c = a[4];
  if (b != a[1] || c != a[3])
    return false;
  return b == a[2] || c == a[2];
}

bool three_card() {
  if (a[0] == a[1]) {
    return a[1] == a[2];
  } else if (a[1] == a[2]) {
    return a[2] == a[3];
  } else {
    return a[2] == a[3] && a[3] == a[4];
  }
}

bool two_pair() {
  set<int> se;
  for (int i = 0; i < 5; i++)
    se.insert(a[i]);
  return se.size() == 3;
}

bool one_pair() {
  set<int> se;
  for (int i = 0; i < 5; i++)
    se.insert(a[i]);
  return se.size() == 4;
}

int main() {
  string s[7] = {
    "four card", "full house", "straight", "three card", "two pair", "one pair", "null"
  };

  char c;
  while (cin >> a[0]) {
    for (int i = 1; i < 5; i++)
      cin >> c >> a[i];
    sort(a, a + 5);
    string res;
    if (four_card()) {
      res = s[0];
    } else if (full_house()) {
      res = s[1];
    } else if (straight()) {
      res = s[2];
    } else if (three_card()) {
      res = s[3];
    } else if (two_pair()) {
      res = s[4];
    } else if (one_pair()) {
      res = s[5];
    } else {
      res = s[6];
    }
    cout << res << endl;
  }
}

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

int Result(int cards[5]){
	int num_card[13];
	bool four=false, three=false, two=false;
	int	num_two=0;
	int min = 12,max = 0;

	for(int i=0;i<13;++i)num_card[i]=0;

	for(int i=0;i<5;++i){
		num_card[ cards[i] - 1 ] ++;
	}



	for(int i=0;i<13;++i){

		if(num_card[i]>0){
			if(i<min)min=i;
			if(i>max)max=i;

			if(num_card[i]==4)four=true;
			else if(num_card[i]==3)three=true;
			else if(num_card[i]==2){
				two=true;
				++num_two;
			}
		}
	}

	if(four)return 7;
	else if(three){
		if(two)return 6;
		else return 4;
	}
	else if(two){
		if(num_two == 2)return 3;
		else return 2;
	}

	if(max-min+1 == 5)
		return 5;

	return 1;
}

void toint(string s, int cards[5]){

	int m=0;


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

		if(s[m]==',' || s[m]=='\0'){
			cards[i] = n;
			++m;
			continue;
		}

		n += n*10 + s[m]-'0';
		++m;
		--n;
	}
}

int main(){

	string s, res;
	int card[5];
	

	cin >> s;

	toint(s,card);

	switch( Result(card) ){
		case 1:res="null";break;
		case 2:res="one pair";break;
		case 3:res="two pair";break;
		case 4:res="three card";break;
		case 5:res="straight";break;
		case 6:res="full house";break;
		case 7:res="four card";break;
	}

	

	return 0;
}

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

using namespace std;

int straight(int[]);

int main() {

	int ans, h[5];

	while(1) {
		ans=0;
		for(int i=0; i<5; i++) {
			cin >> h[i];
		}
		if(cin.eof())
			break;
		for(int i=0; i<4; i++) {
			for(int j=i+1; j<5; j++) {
				if(h[i]==h[j])
					ans++;
			}
		}
		switch(ans) {
			case 1:
				cout << "one pair" << endl;
				break;
			case 2:
				cout << "two pair" << endl;
				break;
			case 3:
				cout << "three cards" << endl;
				break;
			case 4:
				cout << "full house" << endl;
				break;
			case 6:
				cout << "four cards" << endl;
				break;
			default:
				if(straight(h))
					cout << "straight" << endl;
				else
					cout << "null" << endl;
		}
	}
	
	return 0;

}

int straight(int h[5]) {
	
	sort(h, h+5);
	for(int i=0; i<9; i++) {
		if(h[4]==i+4&&h[3]==i+3&&h[2]==i+2&&h[1]==i+1&&h[0]==i||h[0]==1&&h[1]==10&&h[2]==11&&h[3]==12&&h[4]==13)
			return 1;
	}

	return 0;

}

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

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