Go: ///
// File:  0582.go
// Author: ymiyamoto
//
// Created on Wed Feb 28 22:51:48 2018
//
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	steep = iota
	orth
	obtuse
)

func max(a, b, c int) (int, int, int) {
	if a < b {
		if b < c {
			return c, a, b
		} else {
			return b, c, a
		}
	} else {
		if a < c {
			return c, a, b
		} else {
			return a, b, c
		}
	}
}

func triangle(a, b, c int) int {
	if a*a == b*b+c*c {
		return orth
	} else if b*b+c*c-a*a > 0 {
		return steep
	} else {
		return obtuse
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)

	var num, st, or, ob int
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)

		m, n1, n2 := max(a, b, c)
		if m < n1+n2 {
			switch triangle(m, n1, n2) {
			case steep:
				st++
			case orth:
				or++
			case obtuse:
				ob++
			}
			num++
		} else {
			break
		}
	}
	fmt.Println(num, or, st, ob)
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int num[3];
    int sankaku=0,eikaku=0,tyokkaku=0,donkaku=0;
    while(1){
        scanf("%d %d %d", num,num+1,num+2);
        sort(num,num+3);
        if(num[0]+num[1] <= num[2]){
            printf("%d %d %d %d\n",sankaku,tyokkaku,eikaku,donkaku);
            return 0;
        }
        sankaku+=1;
        if(num[0]*num[0] + num[1]*num[1] > num[2]*num[2]) eikaku+=1;
        if(num[0]*num[0] + num[1]*num[1] == num[2]*num[2]) tyokkaku+=1;
        if(num[0]*num[0] + num[1]*num[1] < num[2]*num[2]) donkaku+=1;
    }
}

C++: #include<cstdio>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        scanf("%d%d%d",&a,&b,&c);
        if(c<a){
            change=a;
            a=c;
            c=change;
        }
        if(c<b){
            change=b;
            b=c;
            c=change;
        }
        check=a+b-c;
        value=a*a+b*b-c*c;
        if(check<=0){
            break;
        }
        
        if(value==0){
            right++;
        }
        if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

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

  int a,b,c;
  int X,Y,Z;
  int count1=0,count2=0,count3=0,count=0;

  while(cin >> a >> b >> c   ){
    
    if(a>=b && a>=c){
      X=a;Y=b;Z=c;}
    else if(b>=a && b>=c){
      X=b;Y=a;Z=c;}
    else if(c>=a && c>=b){
      X=c;Y=b;Z=a;}
    if(X>=Y+Z)break;
    else{count++;


    if(X*X==Y*Y+Z*Z){
      count1++;
      
    }
    else if(X*X< Y*Y +Z*Z){
      count2++;}
    else if(X*X> Y*Y +Z*Z){
      count3++;}
    }
  
  }

  cout << count << " " << count1 << " " << count2 << " " << count3 << endl;    
    
  return 0;
}

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

int main() {
  bool flag = true;
  int san = 0, cho = 0, ei = 0, don = 0;
  while (flag) {
    int a, b, c; cin >> a >> b >> c;
    // sankakkei
    if (a + b > c && b + c > a && c + a > b) {
      san++;
      vector<int> v = {a, b, c};
      sort(v.begin(), v.end(), greater<int>());
      //chokkaku
      if (v.at(0) * v.at(0) == v.at(1) * v.at(1) + v.at(2) * v.at(2)) {
        cho++;
      }
      //eikaku
      if (v.at(0) * v.at(0) < v.at(1) * v.at(1) + v.at(2) * v.at(2)) {
        ei++;
      }
      //donkaku
      if (v.at(0) * v.at(0) > v.at(1) * v.at(1) + v.at(2) * v.at(2)) {
        don++;
      }
    } else {
      flag = false;
    }
  }
  cout << san << " " << cho << " " << ei << " " << don << endl;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
    int table[4]={0};
    while(1){
        int a,b,c;
        cin >> a >> b >> c;
        if(a>b&&a>c){
            if(a>=b+c)   break;
            if(a*a==b*b+c*c)  table[1]++;
            else if(a*a<b*b+c*c)  table[2]++;
            else    table[3]++;  
        }
        else if(b>a&&b>c){
            if(b>=a+c)   break;
            if(b*b==a*a+c*c)  table[1]++;
            else if(b*b<a*a+c*c)  table[2]++;
            else    table[3]++; 
        }
        else{
            if(c>=a+b)   break;
            if(c*c==b*b+a*a)  table[1]++;
            else if(c*c<b*b+a*a)  table[2]++;
            else    table[3]++; 
        }
        table[0]++;
    }
    for(int i=0;i<4;i++)    cout << table[i] << " ";
    cout << endl;
    return 0;
}

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

int main(void) {
	int sharp = 0;
	int obtuse = 0;
	int right = 0;
	int i;
	vector<int> a(3);

	while (1) {
		for (i = 0; i < 3; i++) {
			cin >> a[i];
		}

		sort(a.begin(), a.end());

		if (a[0] + a[1] <= a[2] || a[1] + a[2] <= a[0] || a[2] + a[0] <= a[1]) {
			break;
		}

		if (pow(a[0], 2) + pow(a[1], 2) < pow(a[2], 2)) {
			obtuse++;
		}
		else if (pow(a[0], 2) + pow(a[1], 2) == pow(a[2], 2)) {
			right++;
		}
		else {
			sharp++;
		}
	}

	printf("%d %d %d %d\n", right+sharp+obtuse, right, sharp, obtuse);
	return 0;

}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;

int main(){
	int a,b,c;
	int p=0,p1=0,p2=0,p3=0;
		
	while(1){
		scanf("%d %d %d",&a,&b,&c);
		vector<int> s;
		s.push_back(a);
		s.push_back(b);
		s.push_back(c);
		sort(s.begin(),s.end());
		if(s[0]+s[1]<=s[2]||s[1]+s[2]<=s[0]||s[2]+s[0]<=s[1])
		break;
		else{
			p++;
			for(int i=0;i<3;i++) s[i]=s[i]*s[i];
			if(s[0]+s[1]-s[2]==0)
			p1++;
			else if(s[0]+s[1]-s[2]>0)
			p2++;
			else
			p3++;
		}
	}
	printf("%d %d %d %d\n",p,p1,p2,p3);
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

int main(){
	
	int a[3];
	
	int total[4];
	
	bool checker = true;
	
	for(int i = 0; i < 4; i++){
		total[i] = 0;
	}
	
	while(true){
		cin >> a[0];
		if(cin.eof()){
			break;
		}
		cin >> a[1] >> a[2];
		if(checker){
			sort(a, a + 3);
			if(a[0] + a[1] <= a[2]){
				checker = false;
				continue;
			}
			total[0]++;
			if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2]){
				total[1]++;
			}else if(a[0] * a[0] + a[1] * a[1] > a[2] * a[2]){
				total[2]++;
			}else{
				total[3]++;
			}
		}
	}
	
	printf("%d %d %d %d\n", total[0], total[1], total[2], total[3]);
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

int main(){
  int n[3], max = 0;
  int cnt[3] = {0}, ans = 0;
  bool t = true;
  while(cin >> n[0] >> n[1] >> n[2]){
    if(t == true){
      if(n[0] < n[1] + n[2] && n[1] < n[0] + n[2] && n[2] < n[0] + n[1]){
        sort(n, n + 3);
        int sum = n[0] * n[0] + n[1] * n[1] - n[2] * n[2];
        if(sum > 0){
          cnt[1]++;
          ans++;
        }else if(sum == 0){
          cnt[0]++;
          ans++;
        }else{
          cnt[2]++;
          ans++;
        }
      }else{
        t = false;
      }
    }else{
    }
  }
  cout << ans << " ";
  for(int i = 0; i < 2; i++){
    cout << cnt[i] << " ";
  }
  cout << cnt[2] << endl;
}

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

int main(){
  int cyo=0;
  int don=0;
  int ei=0;
  int count=0;

  for(int i=0;i<100;i++){
    int t[3];
    cin>>t[0]>>t[1]>>t[2];
    sort(t,t+3);

    if(t[0]+t[1]<=t[2])break;
    else {
      count++;
      t[0]=t[0]*t[0];
      t[1]=t[1]*t[1];
      t[2]=t[2]*t[2];
      if(t[0]+t[1]==t[2])cyo++;
      if(t[0]+t[1]<t[2])ei++;
      if(t[0]+t[1]>t[2])don++;
    }
  }
  cout<<count<<" "<<cyo<<" "<<don<<" "<<ei<<endl;

}