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 <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	int x,y,t;
	int c=0, h=0;
	while(~scanf("%d,%d,%d", &x, &y, &t)){
		if(x==y)h++;
		if(x*x+y*y==t*t)c++;
	}
	cout<<c<<endl<<h<<endl;
	
	return 0;
}

C++: #include <stdio.h>

int main()
{
	int a, b, c, i, j;

	i = 0;
	j = 0;

	while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
		if(a*a == b*b + c*c) i++;
		if(a == b) j++;
	}

	printf("%d\n%d\n", i, j);

	return 0;
}

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

int main()
{
	int x,y,z ;
	char a,b ;

	int oblnum = 0 ;
	int rhomnum = 0 ;

	while( cin >> x >> a >> y >> b >> z )
	{
		if( ((x*x)+(y*y)) == (z*z) )
		{
			oblnum ++ ;
		}

		if( x == y )
		{
			rhomnum ++ ;
		}
	}

	cout << oblnum << endl ;
	cout << rhomnum << endl ;

	return 0 ;
}

C++: #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>
 
using namespace std;
 
 
bool solve(){
    int a,b,x;
    char ch, ch2;
    int ans = 0, ans2 = 0;
    while(cin>>a){
        cin>> ch>> b>> ch2>> x;
        if(a*a + b*b == x*x) ans++;
        if(a == b) ans2++;
    }
    cout<< ans<< endl;
    cout<< ans2<< endl;
    return true;
}
 
int main(){
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
     
    return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  int a1,a2,a3,count1=0,count2=0,c,c1,c2;
  char b1,b2;
  while(cin>>a1>>b1>>a2>>b2>>a3){
    c=2*(sqrt((a1*a1-a3*a3/4)));
    c1=2*(sqrt(a3*a3+c*c));
    c2=(a1+a2)*2;
    if(a1*a1+a2*a2==a3*a3)
      count1++;
    else if(c2==c1)
      count2++;
  }
  cout<<count1<<endl<<count2<<endl;
  return 0;
}

C++: #include<stdio.h>

int main(){
int x,y,z;
int N=0,W=0;
while(scanf("%d,%d,%d,&x,&y,&z)!=EOF){
if(x!=y)N++;
else if(x==y)W++;
}
printf("%d\n%d\n,N,W);
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 (scanf("%d", &a[0]) != EOF){
    scanf("%d,%d", &a[1], a[2]);
    sort(a, a + 3);
    if (a[0] = a[1]) rhom++;
    else rect++;
  }
  cout << rect << "\n" << rhom << endl;

  return 0;
}

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

using namespace std;

int main(){
	int a,b,c;
	int ans1 = 0 , ans2 = 0;

	while(scanf("%d,%d,%d", &a , &b , &c) != EOF){

		//if(a == 0 && b == 0 && c == 0) break;
		if(a != b && a != c && b != c){
			ans1++;
		}
		if(a == b && a != c && c != b){
			ans2++;
		}
	}

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

	return 0;
}

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

int BT( int N, int S, int d, int p, int s )
{
	if ( d==N )
		return s==S ? 1 : 0;
	int ans = 0;
	for ( int i=p; i<=S; i++ )
		ans += BT(N,S,d+1,i+1,s+i);
	return ans;
}

int main()
{
	while ( true )
	{
		int n, s;
		cin >> n>>s;
		if ( n ==0 && s==0 )
			break;

		cout << BT(n,s,0,0,0) << 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    int a, b, c;
    int cho = 0;
    int hishi = 0;
    while (scanf("%d,%d,%d", &a, &b, &c)!= EOF) {

        if (a == b)
            hishi++;
        if (a*a + b*b == c*c)
            cho++;
        //printf("hishi=%d, cho=%d\n", hishi, cho);
    }

    cout << cho << endl;
    cout << hishi << endl;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

using namespace std;

int main () {
    int side[3];
    int rectangle=0;
    int lozenges=0;
    while(scanf("%d,%d,%d",&side[0],&side[1],&side[2])!=EOF){
        
        
        if(side[0]*side[0]+side[1]*side[1]==side[2]*side[2]){
            rectangle++;
        }else if(side[0]==side[1]){
            lozenges++;
        }
        
    }
    
    cout<<rectangle<<endl<<lozenges<<endl;
    return 0;
}

C++: #include<stdio.h>

int main(){
int x,y,z;
int N=0,W=0;
while(scanf("%d,%d,%d",&x,&y,&z)!=EOF){
if(x!=y)N++;
else if(x==y)W++;
}
printf("%d\n%d\n",N,W);
return 0;
}

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

int main(){
	int ca;
	int cb;
	int a,b,c;
	char n;
	while(cin>>a>>n>>b>>n>>c){
		int d=a*a;
		int e=b*b;
		int f=c*c;
		if(d+e==f){
			++ca;
			}
			
		if(a==b&&a+b>c){
			++cb;
			}	
		}
		cout<<ca<<endl<<cb<<endl;
		return 0;
	}

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

#define TYO 0
#define HIS 1

int main(){
	int in1, in2, in3;
	int ans[2] = {};

	while (scanf("%d,%d,%d", &in1, &in2, &in3) != EOF){
		// 長方形check
		if (pow(in1, 2) + pow(in2, 2) == pow(in3, 2)){
			ans[TYO]++;
		}
		else if (in1 == in2){
			ans[HIS]++;
		}
	}
	for (int i = 0; i < 2; i++){
		cout << ans[i] << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int a,b,c;
  int n1=0,n2=0;

  while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
    if(a*a+b*b==c*c)n1++;
    if(a==b)n2++;
  }
  cout<<n1<<endl;
  cout<<n2<<endl;
}

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

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

C++: 3,4,5
5,5,8
4,4,4
5,4,3