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 <cstdio>
#include <iostream>
#include <vector>
using namespace std;
/* null
 * one pair
 * two pair
 * three card
 * straight
 * full house
 * four card
 * */
int main() {
	vector<int> cards(5);
	while (scanf("%d,%d,%d,%d,%d",&cards[0],&cards[1],&cards[2],
				&cards[3],&cards[4])!=EOF) {
		vector<int> cnt(13, 0);
		for (int i=0; i<5; i++) cnt[cards[i]-1]++;
		int two = 0, three = 0, four = 0;
		for (int i=0; i<13; i++) {
			if (cnt[i] == 2) two++;
			if (cnt[i] == 3) three++;
			if (cnt[i] == 4) four++;
		}
		if (four == 1) {
			printf("four card\n");
			continue;
		} else if (two == 1 && three == 1) {
			printf("full house\n");
			continue;
		} else if (three == 1) {
			printf("three card\n");
			continue;
		} else if (two == 2) {
			printf("two pair\n");
			continue;
		} else if (two == 1) {
			printf("one pair\n");
			continue;
		}
		int c = 0;
		bool flag = false;
		for (int i=0; i<9; i++) {
			if (cnt[i] == 1) {
				if (cnt[i+1]==1&&cnt[i+2]==1&&cnt[i+3]==1&&
						cnt[i+4]==1) {
					flag = true;
					break;
				}
			}
		}
		if (flag||
				(cnt[9]==1&&cnt[10]==1&&cnt[11]==1&&cnt[12]==1&&cnt[0]==1)) {
			printf("straight\n");
		} else {
			printf("null\n");
		}
	}	
}

C++: #include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define INF (2 << 28)
#define fr first
#define sc second
using namespace std;

typedef long long ll;
typedef pair<int, int> iP;

bool isStraight(int a[]) {
  
  bool t[14];
  memset(t, false, sizeof(t));
  for(int i = 0; i < 5; i++) 
    t[a[i] - 1] = true;

  for(int i = 0; i <= 9; i++) {
    bool judge = true;
    for(int j = 0; j < 5; j++) {
      if(!t[(i + j) % 13]) judge = false;
    }
    if(judge) return true;
  }
  return false;
}

int main(){
  
  int a[5];
  while(~scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3], &a[4])) {
    vector< int > S, sum(14, 0);
    for(int i = 0; i < 5; i++)
      sum[a[i]]++;
          
    int maxi = 0, mini = INF;
    for(int i = 1; i <= 13; i++) {
      if(sum[i]) {
        S.push_back(sum[i]);
        mini = min(mini, sum[i]);
        maxi = max(maxi, sum[i]);
      }
    }

    if(maxi >= 4) cout << "four card" << endl;
    else if(maxi == 3 && mini == 2) cout << "full house" << endl;
    else if(isStraight(a)) cout << "straight" << endl;
    else if(maxi == 3) cout << "three card" << endl;
    else if(maxi == 2 && mini == 1 && S.size() == 3) cout << "two pair" << endl;
    else if(maxi == 2) cout << "one pair" << endl;
    else cout << "null" << endl;
  }
}

C++: #include <bits/stdc++.h>
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);
    int ct[14] = {0};
    for (int i = 0; i < 5; i++){
      ct[card[i]]++;
    }

    int a = 0;
    for (int i = 0; i < 4; i++){
      if (card[i] + 1 == card[i + 1]) a++;
    }
    if (card[4] == 13 && card[0] == 1) a++;
    if (a == 4){
      cout << "straight\n";
      continue;
    }
    int ma = 0;
    for (int i = 1; i < 14; i++) ma = max(ma, ct[i]);

    if (ma == 4) {
      cout << "four card\n";
      continue;
    }
    if (ma == 3){
      if (card[0] == card[1] && card[1] != card[2] || card[3] == card[4] && card[3] != card[2]){
        cout << "full house\n";
      }
      else {
        cout << "three card\n";
      }
      continue;
    }
    if (ma == 2){
      int b = 0;
      for (int i = 1; i < 14; i++) if (ct[i] == 2) b++;
      if (b == 2) cout << "two pair\n";
      else cout << "one pair\n";
      continue;
    }
    cout << "null\n";
  }
}

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[15] = {0};
 
        for(int i = 0; i < 5; i ++){
			if(hand[i] == 1) num[14]++;
			num[hand[i]]++;
		} 
        int h[7] = {0};
        string s[] = {"null", "one pair", "two pair", "three card", "straight", "full house", "four card"};
        int seq = 0;
        h[0] = 1;
        for(int i = 1; i < 15; i++){
            if(num[i-1] && num[i]) seq++;
            if(num[i] == 2) h[1]++;
            if(num[i] == 3) h[3]++;
            if(num[i] == 4) h[6]++;
        }
        if(h[1] > 1) h[2]++;
        if(h[1] && h[3]) h[5]++;
        if(seq == 4)
			if(!(num[2] && num[13])) h[4]++;
 
        for(int i = 6; i >= 0; i--){
            if(h[i]){
                cout << s[i] << endl;
                break;
            }
        }
    }
 
 
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(void){
    int a,b,c,d,e;
    std::deque<int> deq;
    char x;
    while (cin>>a>>x>>b>>x>>c>>x>>d>>x>>e) {
        deq.emplace_back(a);
        deq.emplace_back(b);
        deq.emplace_back(c);
        deq.emplace_back(d);
        deq.emplace_back(e);
        sort(deq.begin(),deq.end());
        if ( (deq[0]==deq[1]&&deq[1]==deq[2]&&deq[2]==deq[3]) || (deq[1]==deq[2]&&deq[2]==deq[3]&&deq[3]==deq[4]) ) {
            cout<<"four card"<<endl;
            deq.clear();
        } else if ( (deq[0]==deq[1]&&deq[1]==deq[2]&&deq[3]==deq[4]) || (deq[0]==deq[1]&&deq[2]==deq[3]&&deq[3]==deq[4]) ) {
            cout<<"full house"<<endl;
            deq.clear();
        } else if ( (deq[0]+1==deq[1]&&deq[1]+1==deq[2]&&deq[2]+1==deq[3]&&deq[3]+1==deq[4]) || (deq[0]==1&&deq[1]==10&&deq[2]==11&&deq[3]==12&&deq[4]==13) ) {
            cout<<"straight"<<endl;
            deq.clear();
        } else if ( (deq[0]==deq[1]&&deq[1]==deq[2]) || (deq[1]==deq[2]&&deq[2]==deq[3]) || (deq[2]==deq[3]&&deq[3]==deq[4]) ) {
            cout<<"three card"<<endl;
            deq.clear();
        } else if ( (deq[1]==deq[2]&&deq[3]==deq[4]) || (deq[0]==deq[1]&&deq[3]==deq[4]) || (deq[0]==deq[1]&&deq[2]==deq[3]) ) {
            cout<<"two pair"<<endl;
            deq.clear();
        } else if ( (deq[0]==deq[1]) || (deq[1]==deq[2]) || (deq[2]==deq[3]) || (deq[3]==deq[4]) ) {
            cout<<"one pair"<<endl;
            deq.clear();
        } else {
            cout<<"null"<<endl;
            deq.clear();
        }
    }
}