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 <stdio.h>
#include <stdlib.h>

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

C++: #include<iostream>

using namespace std;

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

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

int main()
{
	int s1,s2,d;
	char ch1,ch2;
    int rect=0,rhom=0;
	while(1){
		cin >> s1 >>ch1>> s2 >>ch2>> d;
		if(cin.eof()) break;
		
		if(s1*s1 + s2*s2 == d*d){
			rect++;
		}else if(s1==s2){
			rhom++;
		}
	}
	cout << rect <<endl << rhom << endl;
	return 0;
}

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

int main()
{
	char ch;
	int re = 0, ro = 0;
	int a, b, c;
	while (cin >> a >> ch >> b >> ch >> c) {
		if (a * a + b * b == c * c) {
			re++;
		}
		if (a == b) {
			ro++;
		}
	}
	cout << re << endl;
	cout << ro << endl;
	return 0;
}

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

using namespace std;

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

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int cnt1 = 0, cnt2 = 0;
	int a, b, c;
	while (scanf("%d,%d,%d", &a, &b, &c)) {
		if (a == b)cnt2++;
		else if (a*a + b*b == c*c)cnt1++;
	}
	cout << cnt1 << endl << cnt2 << endl;
	return 0;
}

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

int main(){
    string s;
    int a = 0, b = 0;
    while(getline(cin,s)){
        int p1, p2, p3;
        sscanf(s.c_str(), "%d,%d,%d", &p1, &p2, &p3);
        if(p1*p1+p2*p2 == p3*p3){
            a++;
        } else 
        if(p1 == p2){
            b++;
        }
    }
    cout << a << endl << b << 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]){
        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 <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	char q;
	int a1,a2,a3,b=0,c=0;
	while(cin>>a1>>q>>a2>>q>>a3){
		if(a1==a2)b++;
		if(a1*a1+a2*a2==a3*a3)c++;
	}
	cout<<c<<endl<<b<<endl;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cstdio>
#include <cmath>
#include <istream>
#include <sstream>
#include <iterator>

using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef pair<int,int> P_II;

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

int main() {
  int a[100][3];
  int rect = 0, lozen = 0;
  map<string,bool> mp;
  OSS oss;
  
  for(int i = 0; scanf("%d,%d,%d", &a[i][0], &a[i][1], &a[i][2])!=EOF; i++) {
    sort(a[i], a[i]+3);
    oss << a[i][0] << "," << a[i][1] << "," << a[i][2];
    if(!mp[oss.str()]) {
      mp[oss.str()] = true;
      if(a[i][0]==a[i][1] || a[i][1]==a[i][2]) lozen++;
      else rect++;
    }
    oss.str("");
  }
  cout << rect << endl << lozen << endl;
  
  return 0;
}

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

void rectangle(int a[4][3]){
  int j, num_rectangle = 0;

  for(j = 0; j < 4; j++){
    if(a[j][0] * a[j][0] + a[j][1] * a[j][1] == a[j][2] * a[j][2]){
      num_rectangle = num_rectangle + 1;
    }
  }
  printf("%d\n", num_rectangle);
}

void rhombus(int b[4][3]){
  int j, num_rhombus = 0;

  for(j = 0; j < 4; j++){
    if(b[j][0] == b[j][1]){
      num_rhombus = num_rhombus + 1;
    }
  }

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

int main(){
  int i, length[4][3];

  for(i = 0; i < 4; i++){
    scanf("%d,%d,%d", &length[i][0], &length[i][1], &length[i][2]);
  }

  rectangle(length);
  rhombus(length);

  return 0;
}

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

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

C++: #include <stdio.h>

int main(void)
{
	int l1, l2, l3;
	int i;
	int count1, count2;
	int n;
	
	count1 = count2 = 0;
	
	while (scanf("%d,%d,%d", &l1, &l2, &l3) != EOF){
		if (l1 == l2){
			count2++;
		}
		
		if (l3 * l3 == l1 * l1 + l2 * l2){
			count1++;
		}
	}
	
	printf("%d\n%d\n", count1, count2);
	
	return (0);
}

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

int main(){
	string str;
	int l1, l2, l3;
	int p;
	int t, h;
	
	t = 0; h = 0;
	while(getline(cin, str)){
		l1 = 0; l2 = 0; l3 = 0; p = 0;
		while(p < str.size() && str[p] != ','){
			l1 = l1 * 10 + (str[p] - 48);
			p++;
		}
		p++;
		while(p < str.size() && str[p] != ','){
			l2 = l2 * 10 + (str[p] - 48);
			p++;
		}
		p++;
		while(p < str.size() && str[p] != ','){
			l3 = l3 * 10 + (str[p] - 48);
			p++;
		}
		
		if(l1 * l1 + l2 * l2 == l3 * l3) t++;
		if(l1 == l2) h++;
	}
	
	cout << t << endl << h << endl;
	
	return 0;
}

C++: #include <iostream>

bool is_lozenge(int side_a, int side_b)
{
	return (side_a == side_b);
}

bool is_rectangle(int side_a, int side_b, int diagonal)
{
	return (side_a * side_a + side_b * side_b == diagonal * diagonal);
}

int main()
{
	char dummy;
	int side_a, side_b, diagonal;
	int no_rectangles = 0, no_lozenges = 0;
	while (std::cin >> side_a >> dummy >> side_b >> dummy >> diagonal) {
//		std::cout << side_a << " " << side_b << " " << diagonal << std::endl;
		if (is_rectangle(side_a, side_b, diagonal) && is_lozenge(side_a, side_b)) {
//			std::cout << "square" << std::endl;
			// ·û`©ÂH`Í³û`Å é
			// DO NOTHING
		} else if (is_rectangle(side_a, side_b, diagonal)) {
//			std::cout << "rectangle" << std::endl;
			no_rectangles++;
		} else if (is_lozenge(side_a, side_b)) {
//			std::cout << "lozenge" << std::endl;
			no_lozenges++;
		} else {
			// DO NOTHING
		}
	}
	std::cout << no_rectangles << std::endl;
	std::cout << no_lozenges   << std::endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
 
using namespace std;
 
const double eps=1e-10;
 
int main()
{
	int a,b,c;
	char d;
	int rec=0,rho=0;
	while(cin>>a>>d>>b>>d>>c){
		if(a*a+b*b==c*c) rec++;
		else if(a==b) rho++;
	}

	cout<<rec<<endl<<rho<<endl;


	return 0;
}