Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	d := 0
	e := 0
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		a, _ := strconv.Atoi(info[0])
		b, _ := strconv.Atoi(info[1])
		c, _ := strconv.Atoi(info[2])
		if a*a + b*b == c*c {
			d++
		}
		if a == b {
			e++
		}
	}
	fmt.Println(d)
	fmt.Println(e)
}

C++: #include <stdio.h>
typedef long long Int;

bool is_rect(Int x, Int y, Int t) {
    return t*t == x*x+y*y;
}

bool is_loze(Int x, Int y, Int t) {
    return x == y;
}

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

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

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

	std::cout<<rec<<std::endl<<dia<<std::endl;
	
	return 0;
}

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

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

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

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<map>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

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

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

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

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

C++: #include <stdio.h>
  int main(){
   int a,b,c;
   int num1=0,num2=0;
   while(scanf("%d,%d,%d",&a,&b,&c) !=EOF){
          if(a==b) num2++;
          else if(a*a+b*b==c*c) num1++;
}
printf("%d\n%d\n",num1,num2);
return 0;
}

C++: #include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD
 
int main(){
  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;
    if(a==b)++y;
  }
  cout<<x<<endl;
  cout<<y<<endl;
  return 0;
}

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

int main(){

  int cnt_s, cnt_r, b[3];
  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];
    b[0] = str[0] - '0';
    b[1] = str[2] - '0';
    b[2] = str[4] - '0';

    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>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(3);

    int arr[3];
    int r = 0, t = 0;
    char c;
    while (cin >> arr[0] >> c >> arr[1] >> c >> arr[2])
    {
        if (arr[0] == arr[1])
            t++;
        if (arr[0] * arr[0] + arr[1] * arr[1] == arr[2] * arr[2])
            r++;
    }

    cout << r << "\n"
         << t << endl;
    return 0;
}

C++: #include<stdio.h>

int main()
{
	int x,y,z,t=0,h=0;
	while(scanf("%d,%d,%d",&x,&y,&z)!=EOF)
	{		
		x*=x;
		y*=y;
		z*=z;

		if(z==(x+y))
		{
			t++;
		}
		else if(x==y)
		{
			h++;
		}
	}
	printf("%d\n%d\n",t,h);
	return 0;
}

C++: #include <iostream>

int main()
{
	int  a, b, c;
	int  rectangle = 0, lozenges = 0;
	char comma;
	while (std::cin >> a >> comma >> b >> comma >> c) {
		if (a*a + b*b == c*c) { // もし直角三角形なら
			rectangle++;
		}
		else if (a == b) {
			lozenges++;
		}
	}
	std::cout << rectangle << '\n' << lozenges << std::endl;
}

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() {
	string s;
	int cnt1 = 0, cnt2 = 0;
	while (cin >> s) {
		int a = (int)s[0] - 48, b = (int)s[2] - 48, c = (int)s[4] - 48;
		if (a == b)cnt2++;
		else if (a*a + b*b == c*c)cnt1++;
	}
	cout << cnt1 << endl << cnt2 << endl;
	return 0;
}

C++: #include <stdio.h>

/* http://rose.u-aizu.ac.jp/onlinejudge/ProblemSet/description.jsp?id=0032&lang=jp */

int main(void)
{
	int alpha=0;
	int beta=0; /*Óa,Ób,Îpüc*/
	int charley=0;
	int rect = 0;/*·û`Ì*/
	int rhom = 0;/*Ðµ`Ì*/


	while(1){
	if(scanf("%d",&alpha) == EOF)  /* EOFðüÍ·éÉÍACtrl+Z */
		break;
	scanf(",%d",&beta);
	scanf(",%d",&charley);

	if( charley*charley == alpha*alpha + beta*beta )
		rect++;

	if( alpha == beta )
		rhom++;

	}


	printf("%d\n",rect);
	printf("%d\n",rhom);

	return 0;
}

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

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

C++: #include <bits/stdc++.h>
 
using namespace std;
 
/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++) 
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()
#define pb push_back
#define mp make_pair 
 
typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;
/*-------------------------------*/
 
int main(void)
{
  int a[3];
  int rect = 0, rhom = 0;
  while (true){
    scanf("%d,%d,%d", &a[0], &a[1], &a[2]);
    sort(a, a + 3);
    if (a[0] = a[1]) rhom++;
    else rect++;
  }
  cout << rect << "\n" << rhom << endl;

  return 0;
}