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>

int pow2(int x);

int main()
{
    int side1, side2, diagonal;
    char ch;

    int cnt_rect = 0, cnt_lozen = 0;

    while (std::cin >> side1 >> ch >> side2 >> ch >> diagonal) {
        if (pow2(side1) + pow2(side2) == pow2(diagonal)) {
            cnt_rect++;
        }
        if (side1 == side2) {
            cnt_lozen++;
        }
    }

    std::cout << cnt_rect << std::endl << cnt_lozen << std::endl;

    return 0;
}

int pow2(int x)
{
    return (x * x);
}

C++: #include <cstdio>

#define square(a) a * a

int main(void)
{
    int e1, e2, dia;
    int rec, diamond;
    
    rec = diamond = 0;
    while (scanf("%d,%d,%d", &e1, &e2, &dia) != EOF){
        if ((square(e1) + square(e2)) == square(dia)){
            rec++;
        }
        else if (e1 == e2) diamond++;
    }
    
    printf("%d\n%d\n", rec, diamond);
}

C++: using namespace std;
#include <iostream>
#include <string>
#include <set>
#include <functional>
#include <vector>
#include <algorithm>
#include <stdio.h>
int main()
{
	int a,b,c;
	char t;
	int cho=0,hishi=0;
	while(cin>>a>>t>>b>>t>>c){
		if(a*a+b*b==c*c)cho++;
		if(a==b)hishi++;
	}
	printf("%d\n%d\n",cho,hishi);
    return 0;
}

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

int main(){
	int c = 0, h = 0;
	int s1, s2, t;
	char a, b;
	while(cin >> s1 >> a >> s2 >> b >> t){
		if(((s1 * s1) + (s2 * s2)) == t * t) c++;
		if(s1 == s2) h++;
	}
	cout << c << endl;
	cout << h << endl;
	return 0;
}

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

int main()
{
	int t=0, h=0;
	int a, b, c;
	string buf;
	while(cin>>buf){
		sscanf(buf.c_str(),"%d,%d,%d", &a, &b, &c);
		if(a==b) h++;
		if(a*a+b*b==c*c) t++;
	}
	cout<<t<<endl<<h<<endl;
	return 0;
}

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

int a,b,c,tyo,hi;

int main(){
	while(cin>>a>>b>>c){
		if(a<b) swap(a,b);
		if(b<c) swap(b,c);
		if(a<b) swap(a,b);
		if(a*a==b*b+c*c) tyo++;
		if(a==b||b==c||c==a) hi++;
	}
	cout<<tyo<<endl<<hi<<endl;

	return 0;
}

C++: #include <stdio.h>

int main(){
  int a,b,c;
  int x=0,y=0;
  while(scanf("%d,%d,%d", &a, &b, &c)!=EOF){
    if(a==b) y++;
    else if(a*a+b*b == c*c) x++;
  }

  printf("%d\n%d\n", x,y);
}

C++: #define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 10
#define MIN -100001
#define _MAX 10
int main(void)
{
	int a, b, c, s = 0, h = 0;
	while (scanf_s("%d,%d,%d", &a, &b, &c) != EOF) {
		if (a == b) ++h;
		else if (c*c == a*a + b*b) {
			++s;
		}
	}
	printf("%d\n%d\n", s, h);
}

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

int main(){
  int a,b,c,h=0,t=0;
  char s;
  while(cin>>a>>s>>b>>s>>c){
    if(a==b)h++;
    else if(a*a+b*b==c*c)t++;
  }
  cout<<t<<endl<<h<<endl;
  return 0;
}

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

int main(){

  int cnt_s, cnt_r, b[3], a;
  string str;
  stringstream ss;

  cnt_s = 0;
  cnt_r = 0;
  while(getline(cin, str)){
    ss << str[0] << " " << str[2] << " " << str[4];
    ss >> b[0] >> b[1] >> b[2];

    if(b[2] < b[0] + b[1]){
      if(b[0] * b[0] + b[1] * b[1] == b[2] * b[2] && b[0] != b[1]){
        cnt_s++;
      }
      else if(b[0] == b[1]){
        cnt_r++;
      }
    }

    ss.str("");
    ss.clear(stringstream::goodbit);
  }

  cout << cnt_s << endl << cnt_r << endl;

  return 0;

}

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int main() {
    int a[3];
    int cnt1=0,cnt2=0;
    while(~scanf("%d,%d,%d",&a[0],&a[1],&a[2])) {
        if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]) cnt1++;
        if(a[0] == a[1] ) cnt2++;
    }
    cout<<cnt2<<endl;
    cout<<cnt1<<endl;
    return 0;
}

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
	int a[3],ans[2];
	char com;
	while(cin>>a[0]>>com>>a[1]>>com>>a[2]){
		ans[0]=0;ans[1]=0;
		sort(a,a+3);
		if(a[2]==a[0]*a[0]+a[1]*a[1])ans[0]++;
		if(a[0]==a[1])ans[1]++;
	}
	cout<<ans[0]<<endl<<ans[1]<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>

#define SIZE 300005
#define MOD 1000000007LL
#define INF INT_MAX / 3
#define LLINF 1LL << 60
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define FORALL(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FOREACH(i,c) for(auto (i) : (c))
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef valarray<int> Array;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cout<<a[i];if(i==a.size()-1)cout<<endl;else cout<<" ";}}
int gcd(int a,int b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
int lcm(int a,int b){return a==0||b==0?0:a*b/gcd(a,b);}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x, y, z;
  int a1 = 0,a2 = 0;
  while (~scanf("%d,%d,%d",&x,&y,&z))
  {
    if(x*x+y*y==z*z) a1++;
    if(x==y) a2++;
  }
  printf("%d\n%d\n",a1,a2);
  return 0;
}

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

int main(){
  int a=0,b=0,c=0;
  int counter[2]={0};

  while((scanf("%d,%d,%d",&a,&b,&c))!=EOF){
    
    if(a*a + b*b == c*c)
      counter[0]++;
    if(a == b)
      counter[1]++;
  }

  printf("%d\n%d\n",counter[0],counter[1]);

  return 0;

}

C++: #include<iostream>
using namespace std;
int main(void)
{
int a,b,c;
int count1=0,count2=0;
char tmp;
while(cin>>a>>tmp>>b>>tmp>>c)
{
if(a*a+b*b==c*c)count1++;
else if(a==b)count2++;

}
cout<<count1<<endl;
cout<<count2<<endl;
return 0;
}

C++: #include<stdio.h>

int main(){
 int l1,l2,dia,rc,lc;
 rc=lc=0;
 while(scanf("%d,%d,%d",&l1,&l2,&dia)!=EOF){
  if(l1*l1+l2*l2==dia*dia){
   rc++;
  }
  if(l1==l2){
   lc++;
  }
 }
 printf("%d\n%d\n",rc,lc);
 return 0;
}

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

int main() {
  int chou=0,hisi=0;
  int x1,x2,x3;

  while(scanf("%d,%d,%d", &x1,&x2,&x3) == 3) {
    if(x3 * x3 == x1*x1 + x2*x2)
      chou++;
    if(x1 == x2)
      hisi++;
  }
  cout << chou << endl << hisi << endl;

}

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

int main() {
	int a, b, c, x = 0, y = 0;
	char t;

	while (cin>>a>>t>>b>>t>>c) {
		if (a*a + b*b == c*c) {
			x++;
		}

		if (a == b) {
			y++;
		}
	}
	cout << x << endl << y << endl;

	return 0;
}