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<cmath>
using namespace std;

int main()
{
	int a,b,c;
	int l=0,h=0;
	while(cin >> a >> b >> c){
		if(pow(a,2) + pow(b,2) == pow(c,2)){
			if(a == b)
				if(a != c)
					++h;
			else
				++l;
		}
	}
	
	cout << l << endl << h << endl;
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int co=0,co1=0,Rectangle=0,Rhombus=0;
    double side[3];
    char str[300];
    while(cin>>str){
        for(int i=0;i<3;i++)side[i]=0;
        for(int i=0;i<=strlen(str);i++){
            if(str[i]==','||str[i]=='\0'){
                for(int j=co;j<i;j++)side[co1]+=(str[j]-'0')*pow(10,i-j-1);
                co=i+1;
                co1++;
            }
        }co=0;co1=0;
        if(side[0]==side[1])Rhombus++;
        else if(side[0]*side[0]+side[1]*side[1]==side[2]*side[2])Rectangle++;
    }
    cout<<Rectangle<<endl<<Rhombus<<endl;
}

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

C++: // 2011/07/02 Tazoe

#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main()
{
	int rct = 0;
	int lzn = 0;

	while(true){
		string str;
		cin >> str;
		if(cin.eof())
			break;

		for(int i=0; i<str.size(); i++)
			if(str[i]==',')
				str[i] = ' ';

		istringstream ist(str);
		int a, b, c;
		ist >> a >> b >> c;

		if(a*a+b*b==c*c)
			rct++;
		if(a==b)
			lzn++;
	}

	cout << rct << endl;
	cout << lzn << endl;

	return 0;
}

C++: #include<stdio.h>

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

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

using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl

#define rep(i,n) for(int i = 0; i < (n);++i)
#define repc(i,a,b) for(int i = (a);i <(b);++i)
#define repa(n,array) for(auto n :(array))

typedef long long ll ;
typedef vector<int> vi ;
typedef vector<ll> vl ;

constexpr int IMAX = ((1<<30)-1)*2+1 ;
constexpr int INF = 100000000;
double EPS = 1e-10 ;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b,c,M = 0,N =0;
  char tmp;
  while(cin >> a >>tmp>> b>>tmp>> c){
    if(a == b){
      ++M;
    }
    else if(a*a+b*b==c*c){
      ++N;
    }
  }
  cout << N << endl << M << endl;
  return 0;
}

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 && !diagonal){
			rhombus_num++;
		}
		
	}
	cout<<rectangle_num<<endl<<rhombus_num<<endl;
	
	return 0;
}

C++: #include<stdio.h>
int main(void){
int x,y,z,i,all,cou=0,cou2=0;
while(scanf("%d,%d,%d",&x,&y,&z)!=EOF){
    if(z*z==x*x+y*y)cou++;
    if(x==y)cou2++;
}
printf("%d\n%d\n",cou,cou2);
return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <stdio.h>

using namespace std;

int sa, sb, d;

vector<string> &split(const string &s, char delim, vector<string> &elems) {
    stringstream ss(s);
    string item;
    while(getline(ss, item, delim)) {
        elems.push_back(item);
    }
    return elems;
}


vector<string> split(const string &s, char delim) {
    vector<string> elems;
    return split(s, delim, elems);
}

int toint(string s) {
    istringstream ss(s);
    int ans;
    ss >> ans;
    return ans;
}

int main(void) {
    string s;
    int rec = 0, loz = 0;
    while(getline(cin, s)) {
        vector<string> v = split(s, ',');
        sa = toint(v[0]);
        sb = toint(v[1]);
        d = toint(v[2]);

        if(sa == sb && d >= sa) loz++;
        if(sa != sb && d > max(sa, sb)) rec++;
    }
    cout << rec << endl << loz << endl;
    return 0;
}

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

C++: #include<iostream>
#include<string>
#include<vector>
#include<sstream>
using namespace  std;
vector<string> split(const string &s,char delimiter)
{
	vector<string> ret;
	size_t now = 0, find;
	while ((find = s.find_first_of(delimiter, now)) != string::npos)
	{
		ret.push_back(string(s, now, find - now));
		now = find + 1;
	}
	ret.push_back(string(s, now, s.size() - now));
	return ret;
}
int main()
{
	string s;
	int b = 0, c = 0;
	while (cin >> s)
	{
		vector<string> sv = split(s, ',');
		int a[3];
		for (int i = 0; i < sv.size(); i++)
		{
			stringstream ss;
			ss << sv[i];
			ss >> a[i];
		}
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2])b++;
		else if(a[2] >= a[0] && a[2] >= a[1]) c++;
	}
	cout << b << endl;
	cout << c << endl;
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

int main() {
	int c1 = 0, c2 = 0;
	int a, b, c; char ch;
	while (cin >> a >> ch >> b >> ch >> c) {
		c1 += a * a + b * b == c * c;
		c2 += a + b >= c && a == b;
	}
	Cout(c1);
	Cout(c2);
}

C++: //長方形⇔直角三角形、ひし形⇔2等辺三角形
//長方形かつひし形の物は、両方カウント
#include<stdio.h>
#include<iostream>
using namespace std;

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

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

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

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

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

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