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

int main()
{
	char c1,c2;
	int len1,len2,len3;
	int count_1 = 0,count_2 = 0;
	while(cin >> len1 >> c1 >> len2 >> c2 >> len3)
	{
		if(len3*len3 == len1*len1 + len2*len2) count_1++;

		if(len1 == len2) count_2++;
	}

	cout << count_1 << endl << count_2 << 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[0] == b[1]){
      cnt_r++;
    }
    else if(b[0] * b[0] + b[1] * b[1] == b[2] * b[2]){
      cnt_s++;
    }
    ss.str("");
    ss.clear(stringstream::goodbit);
  }

  cout << cnt_s << endl << cnt_r << 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(c*c==a*a+b*b) tyo++;
		if(a==b) hi++;
	}
	cout<<tyo<<endl<<hi<<endl;

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
int main(){
  int t=0,h=0;
  int a,b,c;
  char d;
  while(cin>>a>>d>>b>>d>>c){
    if(c==hypot(a,b))t++;
	if(a==b)h++;
  }
  cout<<t<<endl<<h<<endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;


int main(){
	int n1 = 0, n2 = 0, n3 = 0;
	char c1, c2;
	int tyouhou = 0, hishi = 0, count = 0;
		
	while(cin >> n1 >> c1 >> n2 >> c2 >> n3){
		if(n1*n1 + n2*n2 == n3*n3) tyouhou++;
		if(n1 == n2) hishi++;
		count++;
		/*cout << "tyouhou = " << tyouhou << endl;
		cout << "hishi = " << hishi << endl;
		cout << "count = " << count << endl;*/
	}

	cout << tyouhou << endl << hishi << endl;

	return 0;
}

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

int main(void) {
  int a, b, c;
  int rectangle = 0;
  int rhombus = 0;
  
  while(scanf("%d,%d,%d", &a, &b, &c) != EOF) {
    if(c*c == a*a + b*b) {
      ++rectangle;
    } else if(a == b) {
      ++rhombus;
    }
  }
  cout << rectangle << endl
       << rhombus << endl;
}

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

int main(){
	double side1, side2, diagonal, rectangle, rhombus;
	while(cin >> side1 >> side2 >> diagonal){
		if(pow(side1, 2.0) + pow(side2, 2.0) == pow(diagonal, 2.0) && side1 != side2){
			rectangle++;
		}
		else if(pow(side1, 2.0) + pow(side2, 2.0) != pow(diagonal, 2.0) && side1 == side2){
			rhombus++;
		}
	}

	cout << rectangle << endl << rhombus << endl;
}

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

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

char g;
int a,b,c;
int tcnt=0,hcnt=0;

	while(cin >> a >> g >> b >> g >> c){
		if(a*a+b*b == c*c ) tcnt++;
		if(a==b ) hcnt++;
	}
	cout << tcnt <<endl << hcnt << endl;
	return 0;
	
	
}

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

int main(){
    int n,m,d,r=0,l=0;
    char c;
    while(cin>>n>>c>>m>>c>>d){
        if(n==m)
            l++;
        if(n*n+m*m==d*d)
            r++;
    }
    cout<<r<<endl<<l<<endl;
    return 0;
}

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

int main() {
    int a,b,c;
    int rec=0;
    int dia=0;
    char ch;
    while (cin>>a>>ch>>b>>ch>>c) {
        if (a==b&&a*a*2!=c*c)
            dia++;
        else if (a!=b&&a*a+b*b==c*c)
            rec++;
    }
    cout<<rec<<endl<<dia<<endl;
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int a, b, c;
	int cho=0;
	int hi=0;

	while(cin >> a >> b >> c){

		if(a == b){
			hi++;
		}
		if(a*a + b*b == c*c){
			cho++;
		}

	}
	cout << cho << endl << hi << endl;

}

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

int main(){
	
	int a,b,c;
	char d;
	int x=0,y=0;
	double h_a,h_b;
	
	while(1){
		cin >> a;
		if(cin.eof()) break;
		cin >> d >> b;
		cin >> d >> c;
		
		if( c*c == a*a + b*b ) x++;
		else if( a == b ) y++;
		else{
			h_a = sqrt ( a*a - (c*(a+b)/a)*(c*(a+b)/a) ) ;
			h_b = sqrt ( b*b - (c*(a+b)/b)*(c*(a+b)/b) ) ;
			if( h_a == h_b ) y++;
		}
	}
	
	cout << x << endl ;
	cout << y << endl ;
	
return 0;
}

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

int main() {
	int a, b, c, rec=0, dia=0;
	char com;
	while (cin >> a >> com >> b >> com >> c) {
		if (a * a + b * b == c * c) {
			rec++;
		}
		else if (a == b) {
			dia++;
		}
	}

	cout << rec << endl;
	cout << dia << 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)
				++counth;
			else
				++countt;
		}
		else
			if(a == b)
				++counth;
	}
	cout << countt << endl;
	cout << counth << endl;
	system("pause");
	return 0;
}

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

int main(void){
	int x,y,t,t_c,squ=0,his=0;
	
	while(scanf("%d,%d,%d",&x,&y,&t)!=EOF){
		t_c=sqrt(x*x+y*y);
		if(x==y || x==y==t)his++;
		else if(t==t_c )squ++;
		
	}
	printf("%d\n%d\n",squ,his);
return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#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>

int main(){
  int a,b,c,n=0,m=0;
  while(~scanf("%d,%d,%d",&a,&b,&c)){
    if(a*a+b*b=c*c) n++;
    if(a==b) m++
  }
  printf("%d\n%d\n",n,m);
}

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

C++: #include <stdio.h>

int
main(void)
{
	char line[80];

	int a, b, c;

	int h = 0;
	int r = 0;
	
	while (true) {
		if (fgets(line, sizeof line, stdin) == NULL) {
			break;
		}
		if (sscanf(line, "%d,%d,%d", &a, &b, &c) != 3) {
			break;
		}

		if (a*a + b*b == c*c) {
			h ++;
		} else if (a == b) {
			r ++;
		}
	}
	
	printf("%d\n%d\n", h, r);

	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(){
    int a[3];
    int c=0,h=0;
    while(~scanf("%d,%d,%d",&a[0],&a[1],&a[2])){
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) c++;
        if(a[0]==a[1]) h++;
    }
    printf("%d\n%d\n",c,h);
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){

	int a,b,c;
	int x=0,y=0;
	while(scanf("%d,%d,%d",&a,&b,&c)){
        if(a*a+b*b==c*c){
            x++;
            //cout<<a<<b<<c<<endl;
        }
        if(a==b){
            y++;
           // cout<<a<<b<<c<<'.'<<endl;
        }
	}
	cout<<x<<endl<<y<<endl;


	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", tyou, hisi);
}