Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var rectangle, diamond int
	for sc.Scan() {
		l := strings.Split(sc.Text(), ",")
		a, _ := strconv.Atoi(l[0])
		b, _ := strconv.Atoi(l[1])
		c, _ := strconv.Atoi(l[2])

		if a*a+b*b == c*c {
			rectangle++
		}
		if a == b {
			diamond++
		}
	}
	fmt.Println(rectangle)
	fmt.Println(diamond)
}

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

using namespace std;

int main(){
	int a,b,c;
	int ans1 = 0 , ans2 = 0;

	while(scanf("%d,%d,%d", &a , &b , &c)){

		if(a == 0 && b == 0 && c == 0) break;
		if(a != b && a != c && b != c){
			ans1++;
		}
		if(a == b && a != c && c != b){
			ans2++;
		}
	}

	cout << ans2 << endl;
	cout << ans1 << endl;

	return 0;
}

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

int main(void)
{
	int a,b;
	int t;

	int countt;
	int counth;

	char input[100];

	while(1)
	{
		gets(input);
		a = input[0] - '0';
		b = input[2] - '0';
		t = input[4] - '0';
		if(a*a+b*b == t*t)//直角を持つ
		{
			if(a == b)
				++countt;
			else
				++counth;
		}
		else
			if(a == b)
				++counth;
		if(input[5] == EOF)
			break;
	}
	cout << countt << endl;
	cout << counth << endl;
	return 0;
}

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

int main() {
	int a, b, c;
	int ca=0, cb=0;
	while (scanf("%d, %d, %d", &a, &b, &c)+1) {
		if ((a*a) + (b*b) == c*c) { ca++; }

		if (a == b) { cb++; }
	}
	printf("%d\n%d/n", ca, cb);
	return 0;
}

C++: #include <cstdio>

using namespace std;

int main()
{
  int x, y, r, hisi = 0, tyou = 0;
  while (scanf("%d %d %d ", &x, &y, &r) == 3) {
    if (x == y) {hisi++;}
    if (x * x + y * y = r * r) {tyou++;}
  }
  
  printf("%d\n%d\n", hisi, tyou);
}

C++: #include <iostream>

using namespace std;

int main(){
	int a, b, c, hantei, t = 0, h = 0;
	
	while(cin >> a >> b >> c){
		if(a == b || b == c || a == c){
			h++;
		}

		else if(a > b){
			if(b > c){
				if(a * a - b * b - c * c == 0){
					t++;
				}
			}

			else if(c > b && c < a){
				if(a * a - b * b - c * c == 0){
					t++;
				}
			}
		}


		else if(b > a){
			if(a > c){
				if(b * b - a * a - c * c == 0){
					t++;
				}
			}

			else if(c > a && c < b){
				if(b * b - a * a - c * c == 0){
					t++;
				}
			}
		}

		else{
			if(a > b){
				if(c * c - b * b - c * c == 0){
					t++;
				}
			}

			else if(b > a && b < c){
				if(c * c - b * b - c * c == 0){
					t++;
				}
			}
		}
	}
		cout << t << endl;
		cout << h << endl;

		return 0;
	}

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>

using namespace std;

int main()
{
  int a, b, c;
  char d;
  int r = 0, l = 0;

  while ( cin >> a >> d >> b >> d >> c )
    {
      if ( a * a + b * b == c * c )
        {
          if ( a != b ) ++r;
        }
      else
        {
          if ( a == b ) ++l;
        }
    }

  cout << r << endl;
  cout << l << endl;
  
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define drep(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define Sort(x) sort((x).begin(),(x).end())
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000009
#define pb push_back
#define mp make_pair
typedef long long ll;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

ll gcd(ll a,ll b){
    if(a<b){
        int t=a;a=b;b=t;
    }
    int c=a%b;
    while(c!=0){
        a=b;
        b=c;
        c=a%b;
    }
    return b;
}

ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}

bool isPrime(int x){
    if(x==1)return false;
    if(x==2)return true;
    if(x%2==0)return false;
    for(int i=3;i<=sqrt(x);i+=2){
        if(x%i==0)return false;
    }
    return true;
}

int kaizyo(int x){
    if(x==1)return x;
    else return x*kaizyo(x-1);
}


int main() {
    int a,b,c;
    char x;
    int ans1=0,ans2=0;
    while(cin>>a>>x>>b>>x>>c){
        if(a==b&&b==c)continue;
        if(a*a+b*b==c*c)ans1++;
        else ans2++;
    }
  cout<<ans1<<endl<<ans2<<endl;
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<stdlib.h>
#include<memory.h>
using namespace std;
int main(){
	int in;
	int a[3] = { 0 };
	int b=0, c=0;
	int l;
	bool flag = true;
	while (flag){
		l = 0;
		memset(a, 0, sizeof(a));
		while ((in = getchar()) != '\n'){
			if (in == EOF){ cout << b << endl << c << endl; return 0; }
			if (in == ',')l++;
			if (in != ','&&in>='0'&&in<='9'){
				a[l] = a[l] * 10 + (in - '0');		
			}
		}
		if (a[0] == a[1])
			c++;
		if (a[2] * a[2] == a[0] * a[0] + a[1] * a[1])
			b++;
	}
}

C++: #include <cstdio>

using namespace std;

int main()
{
	int a,b,c,rh=0,re=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(a*a+b*b==c*c){
			re++;
		}
		else if(a==b){
			rh++;
		}
	}
	printf("%d\n",re);
	printf("%d\n",rh);
	
	return 0;
}

C++: //48
#include<iostream>

using namespace std;

int main(){
  int cho=0,hishi=0;
  for(int a,b,c;((cin>>a).ignore()>>b).ignore()>>c;){
    hishi+=a==b;
    cho+=c*c==a*a+b*b;
  }
  cout<<cho<<endl<<hishi<<endl;
  return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	int a, b, c;
	while(cin >> a >> b >>c){
		int rect,rhom;
		if(a * a + b * b == c * c) rect++;
		else if(a == b) rhom++;
	}
	cout << rect << "?\n" << rhom << endl;
}

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

int main()
{
	int a, b, c;
	int r = 0;
	int l = 0;
	while (scanf_s("%d,%d,%d", &a, &b, &c) != EOF ) {
		if (a*a + b*b == c*c) {//??´?§?????§???¢
			r++;
		}
		else if (a == b) {//?????????????§???¢
			l++;
		}
	}
	cout << r << endl;
	cout << l << endl;
	
    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int s1, s2, s3;
	int re = 0, rh = 0;

	while (scanf("%d,%d,%d", &s1, &s2, &s3) != EOF)
	{
		if (s1*s1 + s2*s2 == s3*s3) re++;
		if (s1 == s2) rh++;
	}

	cout << re << "\n" << rh << endl;

	return 0;
}

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

using namespace std;

int main(){

  int in[3];
  char trash;
  int sumt = 0, sumh = 0;

  while(cin >> in[0] >> trash >> in[1] >> trash >> in[2]){


    sort(in,in+3);
    if(in[1] == in[0] && in[2] == in[0]){

    }else if(in[2]*in[2] == in[0]*in[0] + in[1]*in[1]){
      sumt++;
    }else if(in[0] == in[1] || in[1] == in[2]){
      sumh++;
    }
  }

  cout << sumt << endl << sumh << endl;

  return 0;

}

C++: #include <cstdio>

int main()
{
  int a, b, c, c1, c2;
  c1 = c2 = 0;
  while (scanf("%d,%d,%d", &a, &b, &c) != EOF){
    if (c * c - a * a - b * b == 0){
      c1++;
    }
    if (a == b){
      c2++;
    }
  }
  printf("%d %d\n", c1, c2);

  return 0;
}

C++: #include<iostream>
using namespace std;
    int main(void){
    int a,b,c;
    int count_a=0,count_b=0;
    char x;
    while(cin >> a >> x >> b >> x >>c){
        if(a*a + b*b == c*c) count_a++;
        else if(a == b) count_b++;
    }
    cout << count_a << endl;
    cout << count_b << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a, b, c;
    int X = 0, Y = 0;
     
    while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
        if(a * a + b * b == c * c) X++;
        else if(a == b) Y++;
    }
    cout << X << endl;
    cout << Y << endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int rect_cnt = 0;
	int lzng_cnt = 0;
	int a, b, c;
	char dummy;
	
	while ( cin >> a >> dummy >> b >> dummy >> c ) {
		if (a==b) {
			lzng_cnt++; continue;
		}
		if ( a*a + b*b == c*c ) rect_cnt++;
	}
	
	cout << rect_cnt << endl << lzng_cnt << endl;
	
	return 0;
}