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++: import sys
rec=rho=0
for line in sys.stdin:
#while True:
#	line=raw_input()
	if line=="a":
		break
	a,b,c=map(int,line.split(","))
	if a==b:
		rho+=1
	elif a*a+b*b==c*c:
		rec+=1
print rec
print rho

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

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

int main(){
	string s;
	int a,b,c;
	int ch=0,hi=0;
	while(cin >> s){
		sscanf(s.c_str(),"%d,%d,%d",&a,&b,&c);
		if(a*a+b*b==c*c){
			ch++;
		}else if(a==b){
			hi++;
		}
	}
	cout << ch << endl << hi << endl;
}

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

int main(){
	vector<int> num(3);
	set<string> rectangle, lozenge;
	while( ~scanf("%d,%d,%d", &num[0], &num[1], &num[2]) ){
		sort(num.begin(), num.end());
		string temp = "";
		for(int i=0; i<3; i++) temp += '0'+num[i];
		if( temp[0] == temp[1] || temp[1] == temp[2] ) lozenge.insert(temp);
		else rectangle.insert(temp);
	}
	/*
	set<string>::iterator it1 = rectangle.begin();
	set<string>::iterator it2 = lozenge.begin();
	for(; it1!=rectangle.end(); it1++ ) cout << *it1 << endl;
	cout << endl;
	for(; it2!=lozenge.end(); it2++ ) cout << *it2 << endl;
	cout << endl;
	*/
	cout << rectangle.size() << endl;
	cout << lozenge.size() << endl;
}

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

int main(void)
{
	double a, b, c;
	int tyouhoukei = 0, hisigata = 0;
	char op;
	while (cin >> a >> op >> b >> op >> c)
	{
		if (a == b) hisigata++;
		else if (sqrt(a * a + b * b) == c) tyouhoukei++;
	}
	cout << tyouhoukei << endl << hisigata << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;

int main(){
    int mod=1000000007;
    int a,b,c;
    int ans[2]={0,0};
    while (scanf("%d,%d,%d",&a,&b,&c)!=EOF) {
        if (a==b && b==c) continue;
        int tmp=(max(a,max(b,c)))*(max(a,max(b,c)))-(min(a,min(b,c)))*(min(a,min(b,c)));
        if (tmp==a*a || tmp==b*b || tmp==c*c) ans[1]+=1;
        else ans[0]+=1;
    }
    printf("%d\n%d\n",ans[0],ans[1]);
    return 0;
}

C++: #include <iostream>
using namespace std;
 
int main()
{
    int a = 0, b = 0;
    int x,y,z;
    char a, b;
    while(cin >> x >> a >> y >> b >> z)
   {
        if(((x * x) + (y * y)) == z* z) a++;
        if(x == y) b++;
    }j
    cout << a << endl;
    cout << b << endl;
    return 0;
}

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

int main()
{
	std::uint32_t num_rectangles = 0;
	std::uint32_t num_lozenges = 0;
	std::uint32_t side1, side2, diagonal;
	char comma;
	while (std::cin >> side1 >> comma >> side2 >> comma >> diagonal) {
		if (side1 * side1 + side2 * side2 == diagonal * diagonal) {
			++num_rectangles;
		}
		else if (side1 == side2) {
			++num_lozenges;
		}
	}
	std::cout << num_rectangles << '\n' << num_lozenges << std::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*a + b*b == c*c){
			cho = cho + 1;
		}
		if(a==b){
			hi = hi + 1;
		}
	}
	cout << cho << endl;
	cout << hi << endl;
}

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

int main() {
	int r1, r2, r;
	char c;
	int cnt[2] = {0, 0};
	while (cin >> r1 >> c >> r2 >> c >> r) {
		if (r1==r2) cnt[1]++;
		else if (r1*r1+r2*r2==r*r) cnt[0]++;
	}
	cout << cnt[0] << endl << cnt[1] << endl;
	return 0;
}

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

using namespace std;

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

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

int main() {
	int a, b, c;
	char r;
	int rec, loz;
	rec = 0;
	loz = 0;
	while (cin >> a >> r >> b >> r >> c){
		if (a == b){
			loz += 1;
		}else if (a * a + b * b == c * c){
			rec += 1;
		}
	}
	cout << rec << endl << loz << endl;
}

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

int main(){
    int a,b,c,x,y;
    
    x = y = 0;
    
    while(scanf("%d,%d,%d" ,&a,&b,&c) != EOF){
        if(pow(a,2)+pow(b,2)==pow(c,2)) x++;
        if(a==b) y++;
    }
    
    printf("%d\n%d\n" ,x ,y);
    
    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int x, y, d;
    int rect, lozen;
    char comma;

    rect = lozen = 0;
    while (cin >> x >> comma >> y >> comma >> d) {
        if (x * x + y * y == d * d)
            rect++;
        else if (x == y)
            lozen++;
    }
    cout << rect << '\n' << lozen << endl;

    return 0;
}

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

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

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

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

 	return 0;
}

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

int a, b, c;
int num_rect;
int num_rhombus;

int main() {
  while (1) {
    if (scanf("%d,%d,%d", &a, &b, &c) != 3) break;
    if (a*a+b*b == c*c) num_rect++;
    if (a == b) num_rhombus++;
  }

  printf("%d\n", num_rect);
  printf("%d\n", num_rhombus);
}

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

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int rectNum = 0;
	int rhomNum = 0;
	int a;
	int b;
	int c;
	while( scanf("%d,%d,%d", &a, &b, &c) != EOF )
	{
		if( a == b )
		{
			rhomNum++;
		}
		if( a * a + b * b == c * c )
		{
			rectNum++;
		}
	}
	printf("%d\n%d\n", rectNum, rhomNum);
	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)
				++countt;
			else
				++counth;
		}
		else
			if(a == b)
				++counth;
	}
	cout << countt << endl;
	cout << counth << endl;
	return 0;
}

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

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

int main()
{
  int a[3];
  char del;

  int rect=0, loz=0;
  while(cin >> a[0] >> del >> a[1] >> del >> a[2]){
    if( abs(a[0]-a[1]) < a[2] && a[2] < a[0]+a[1] ){

      if( a[2]*a[2] == a[0]*a[0] + a[1]*a[1])
	rect++;
      else if(a[0] == a[1])
	loz++;
      
    }
  }
  cout << rect << endl;
  cout << loz << endl;
  return 0;
}