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

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

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]){
        if(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 <iostream>
using namespace std;
int main( void )
{
  int a,b,c,n=0,m=0;
  char s,t;
  while( 1 ){
    cin>>a>>s>>b>>t>>c;
    if( cin.eof() ) break;
    if( a*a+b*b == c*c ) n++;
    if( a == b ) m++;
  }
  cout << n << endl;
  cout << m << endl;
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int a, b, c, sum1,sum2;
	sum1 = 0;
	sum2 = 0;
	while (scanf("%d,%d,%d",&a,&b,&c)) {
		if (a*a + b*b == c*c) {
			sum1 += 1;
		}
		if (a == b) {
			sum2 += 1;
		}
	}
	cout << sum1 << endl;
	cout << sum2 << endl;
	return 0;
}

C++: import sys
x,y=0,0
for line in sys.stdin:
	a,b,c = map(int,line[:-1].split(','))
	if a*a + b*b == c*c:
		x += 1
	if a == b:
		y += 1
print("{}\n{}".format(x,y))

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

int main(){
	int a, b, tai, p1=0, p2=0;
	while(scanf("%d,%d,%d",&a,&b,&tai)!=EOF){
		if(a*a+b*b==tai*tai)p1++;
		if(a==b)p2++;
	}
	cout<<p1<<endl<<p2<<endl;
	return 0;
}

C++: #include<cstdio>

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

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

int a, b, c;
int rec, loz;

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

	return 0;
}

C++: #include <cstdio>

using namespace std;

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

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

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

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

int x, y, z;

int re=0, di=0;

int main(){
	while(scanf("%d,%d,%d", &x, &y, &z) != EOF){
		if(x*x + y*y == z*z) re++;
		else if(x == y) di++;
	}
	cout << re << endl;
	cout << di << endl;
}

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

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

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

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

int main()
{
	int rectnum = 0;
	int lozenum = 0;
	while(true)
	{
	int a,b,c;
	cin >> a;
	if(cin.eof())break;
	fgetc(stdin);
	cin >> b;
	fgetc(stdin);
	cin >> c;
	if((a*a+b*b)==c*c||(b*b+c*c)==a*a||(c*c+a*a)==b*b)rectnum++;
	if(a==b||b==c||c==a)lozenum++;
	}
	cout << rectnum << endl;
	cout << lozenum << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int x, y, z;
	int rect_count = 0;
	int lozenge_count = 0;
	while(~scanf("%d,%d,%d", &x, &y, &z))
	{
		if(x * x + y * y - z * z == 0)
		{
			rect_count++;
		}
		else if(x == y)
		{
			lozenge_count++;
		}
	}
	cout << rect_count << endl;
	cout << lozenge_count << endl;
}

int main()
{
	solve();
	return(0);
}

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

int main()
{
	int rectangles = 0;
	int lozenges = 0;
	unsigned int side1, side2, diagonal;
	while (std::scanf("%d,%d,%d", &side1, &side2, &diagonal) == 3) {
		if (side1 + side2 > diagonal) {
			if (side1 * side1 + side2 * side2 == diagonal * diagonal) {
				++rectangles;
			}
			if (side1 == side2) {
				++lozenges;
			}
		}
	}

	std::cout << rectangles << '\n' << lozenges << '\n';

	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int a,b,c,h=0,w=0;
	char d;
	while(cin>>a>>d>>b>>d>>c){
		if(a==b)
			h++;
		if(a*a+b*b==c*c)
			w++;
		cout<<w<<" "<<h<<endl;
	}
	cout<<w<<endl;
	cout<<h<<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++;
		}
		if(a==b){
			hi++;
		}
	}
	cout << cho << endl << hi << endl;
}

C++: //#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>
//#include <map>

using namespace std;


int main(){

	int e1, e2, e3;
	char c;
	int ans1 = 0,ans2 = 0;

	while (cin >> e1 >> c >> e2 >> c >> e3){
		if (e1 == e2) ans2++;

		if (e1 * e1 + e2 * e2 == e3 * e3) ans1++;
	}

	cout << ans1 << endl;
	cout << ans2 << endl;

	return 0;
}

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

int main(void) {
    string s;
    int rect = 0, rhom = 0;
    while (cin >> s) {
        replace(s.begin(), s.end(), ',', ' ');
        stringstream ss(s);
        int x, y, z;
        ss >> x >> y >> z;

        if (x == y || y == z || z == x) rhom++;
        else if (x*x + y*y == z*z) rect++;
    }

    cout << rect << endl;
    cout << rhom << endl;

    return 0;
}

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

using namespace std;

int main() {
  int a, b, c;
  int rect = 0;
  int dia = 0;
  while(scanf("%d,%d,%d", &a, &b, &c) != -1) {
    if(a == b && b == c && c == a) {
    }else if (a == b) {
      dia++;
    }else {
      rect++;
    }
  }

  cout << dia << endl;
  cout << rect << endl;

  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>

int main(void){
	std::string input, buf;
	std::stringstream ss;
	int a[3];
	int i, ab, c;
	int Rectangle=0, Diamond=0;
	while(std::cin >> input){
		i=0;
		ss << input;
		while(getline(ss, buf,',')){
			a[i++] = std::atoi(buf.c_str());
		}
		ab = a[0]*a[0] + a[1]*a[1];
		c = a[2]*a[2];
		if(ab==c) Rectangle++;
		if(a[0]==a[1] && ab!=c) Diamond++;

		ss.str("");
		ss.clear(std::stringstream::goodbit);
	}
	std::cout << Rectangle << std::endl << Diamond << std::endl;
	return 0;
}