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 <bits/stdc++.h>
#define PI 3.14159265359
using namespace std;

int main() {
	int a, b, c;
	int a1 = 0, a2 = 0;
	char ch;

	while (cin >> a >> ch >> b >> ch >> c) {
		int x =a * a + b * b;
		if (x == c*c) {
			a1++;
		}
		else {
			if (a == b) {
				a2++;
			}
		}
	}

	cout << a1 << endl;
	cout << a2 << endl;
}

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

int main(){
	vector<int> num(3);
	int rc, lc;
	rc = lc = 0;
	while( ~scanf("%d,%d,%d", &num[0], &num[1], &num[2]) ){
		if( num[0] == num[1] ) lc++;
		else if( num[0]*num[0]+num[1]*num[1] == num[2]*num[2] ) rc++;
	}
	cout << rc << endl;
	cout << lc << endl;
}

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

int main(){
  int a[1000],b[1000],c[1000],i,j,cnt=0,cnt2=0;

  j=0;
  while(scanf("%d,%d,%d",&a[j],&b[j],&c[j])!=EOF){
    if(a[j] == b[j])cnt2++;
    else if(pow(a[j],2)+pow(b[j],2) == pow(c[j],2))cnt++;

    j++;
  }  

  cout << cnt << endl;
  cout << cnt2 << endl;


}

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

int main() {
  int a,b,c,r=0,l=0;
  while(scanf("%d%*c%d%*c%d",&a,&b,&c)==3) {
    if(a*a+b*b==c*c) r++;
    else if(a==b) l++;
  }
  cout << r << endl << l << endl;
  return 0;
}

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

int main(){
  int a, b, c;
  int tyou = 0;
  int hishi = 0;
  
  while(scanf("%d,%d,%d\n", &a, &b, &c)!=EOF){
    if(a==b || a==c || b==c){
      if(a+b>c && b+c>a && c+a>b){
        hishi++;
      }
    }
      if(a>b){
        if(a>c){
          if(a*a==b*b+c*c) tyou++;
        }else{
          if(c*c==a*a+b*b) tyou++;
        }
      }else{
        if(b>c){
          if(b*b==a*a+c*c) tyou++;
        }else{
          if(c*c==a*a+b*b) tyou++;
        }
      }
    
  }
  
  std::cout << tyou << std::endl << hishi << std::endl;
  
  return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1e9 + 7;
const long long INF = 1LL << 60;

int main() 
{
    string s;
    int t = 0,h = 0;
    int a,b,c;
    while(scanf("%d,%d,%d",&a,&b,&c)+1){
        if(a * a + b * b == c * c) t++;
        else if(a == b) h++;
    }
    cout << t << endl;
    cout << h << endl;
}

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

int main()
{
	int t=0, h=0;
	int a, b, c;
	while(scanf("%d,%d,%d", &a, &b, &c)){
		vector<int> all;
		all.push_back(a);
		all.push_back(b);
		all.push_back(c);
		sort(all.begin(), all.end());
		if(all[0]==all[1]) h++;
		if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) t++;
	}
	cout<<t<<endl<<h<<endl;
	return 0;
}

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

int main(){
  int a, b, c; char x;
  int rectangle = 0, diamond = 0;
  while(cin >> a >> x >> b >> x >> c){
    if(a*a + b*b == c * c) rectangle++;
    if(a == b) diamond++;
  }

  cout << rectangle << endl;
  cout << diamond << endl;
}

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

int main()
{

	int a,b,c,ans = 0,ans2 = 0;

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

		if(a == b && a!=c && b!=c)
		{
			ans += 1;
		}

		else if(a != b && a!=c && b!=c)
		{
			ans2 += 1;
		}

	}

	cout << ans << endl;
	cout << ans2 << endl;

	return 0;
}

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

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

	int countt=0;
	int counth=0;

	char input[100];

	while(!cin.eof())
	{
		cin >> input;
		a = input[0] - '0';
		b = input[2] - '0';
		t = input[4] - '0';
		if(a*a+b*b == t*t)//直角を持つ
		{
			if(a == b);
			else
				++countt;
		}
		else
			if(a == b)
				++counth;
	}
	cout << countt << endl;
	cout << counth << endl;
	//system("pause");
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	string s;
	int cnt1 = 0, cnt2 = 0;
	while (cin >> s) {
		int a = (int)s[0] - 48, b = (int)s[2] - 48, c = (int)s[4] - 48;
		if (a == b)cnt2++;
		if (a*a + b*b == c*c)cnt1++;
	}
	cout << cnt1 << endl << cnt2 << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int a,b,c;
	int tsum,hsum;
	tsum=hsum=0;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		if(a==b)	hsum++;
		else{
			if(a<b&&b<c||a>b&&a<c)	tsum++;
		}
	}
	cout<<tsum<<endl;
	cout<<hsum<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(ll i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int a, b, c;
	string s;
	int cnt1 = 0, cnt2 = 0;
	while (cin >> s) {
		a = s[0], b = s[2], c = s[4];
		if (a == b)cnt2++;
		else if (a*a + b*b == c)cnt1++;
	}
	cout << cnt1 << ' ' << cnt2 << endl;
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[])
{
  int a,b,c;
  int rectangles = 0;
  int lozenges = 0;;
  
  while(scanf("%d,%d,%d",&a,&b,&c) != EOF){
    if(a==b){
      lozenges++;
    }
    else if(c*c ==a*a+b*b){
      rectangles++;
    }
  }
  cout <<rectangles<<endl;
  cout<<lozenges<<endl;
  return 0;
}

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

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

int main(){
  int a,b,c;
  int lozenges = 0,rectangle = 0;
  while(~scanf("%d,%d,%d",&a,&b,&c)){
  if(a == b)lozenges++; 
  if(c*c == (a*a + b*b) )rectangle++;
  }
  cout << rectangle << endl;
  cout << lozenges << endl;
}

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

using namespace std;

int main()
{
	int rectangle_num =0, rhombus_num=0;
	
	int side1, side2, diagonal;
	while( scanf("%d,%d,%d", &side1, &side2, &diagonal) != EOF ){
		if(side2 > side1) swap(side1, side2);
		
		// 長方形の判定
		if( side1*side1 + side2*side2 == diagonal*diagonal){
			rectangle_num++;
		}else if( side1==side2){
			rhombus_num++;
		}
		
	}
	cout<<rectangle_num<<endl<<rhombus_num<<endl;
	
	return 0;
}

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

using namespace std;
int main()
{
	vector<vector<int> > n;
	int ch = 0;
	int hisi = 0;
	int i, j,k,l = 0;
	while (scanf_s("%d,%d,%d",&i,&j,&k) != EOF) {
		vector<int>v;
		
		v.push_back(i);
		v.push_back(j);
		v.push_back(k);
		sort(&v[0], &v[2]);
		n.push_back(v);
		l++;
	}
	for (int a = 0; a < l; a++) {
		
		if ((n[a][0] ^ 2 )== ((n[a][1] ^ 2 )+ (n[a][2] ^2))) {
			if (!(n[a][0] == n[a][1] == n[a][2])) {
				ch++;
			}
		}
		else if ((n[a][0] == (n[a][1] || n[a][2])) || (n[a][1] == n[a][2])) {
			if (!(n[a][0] == n[a][1] == n[a][2])) {
				hisi++;
			}
		}
	}
	cout << ch << "\n" << hisi << endl;

	return 0;
}

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

int main(){
  string d1,d2,d3;
  int a1,a2,a3;
  int c1=0,c2=0;
  while(getline(cin,d1,',')){
    a1 = atoi(d1.c_str());
    getline(cin,d2,',');
    a2 = atoi(d2.c_str());
    getline(cin,d3,'\n');
    a3 = atoi(d3.c_str());
    if (a1*a1+a2*a2==a3*a3)
      c1++;
    if (a1==a2)
      c2++;
  }
  cout <<c1<<endl<<c2<<endl;
  return 0;
}