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>
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)count2++;
  }
  cout << count1 <<"\n"<< count2 << endl;
  
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int t=0,h=0;
int x,y,z;
while(scanf("%d,%d,%d",&x,&y,&z)!=EOF){
if(x*x+y*y==z*z){
t++;
}
if(x==y){
h++;
}
}
cout<<t<<endl<<h<<endl;
return 0;
}

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

#define gcu getchar_unlocked
#define ii inline int in
ii(int c) {
	int n = 0;
	bool minus = false; if (c == '-') minus = true, c = gcu();
	do {n = 10 * n + (c - '0'), c = gcu();} while (c >= '0');
	//return n; }
	return minus ? -n : n; }
ii() {return in(gcu());}
//void scan(string &s) {for (char c; !isspace(c = gcu()); s += c);}
inline bool scan(int &n) {int c=gcu();return c==EOF?false:(n=in(c),true);}
#undef ii
#define pcu putchar_unlocked
template <typename T>
void out(T n) {
	static char buf[20];
	char *p = buf;
	if(n < 0) pcu('-'), n *= -1;
	if (!n) *p++ = '0';
	else while (n) *p++ = n % 10 + '0', n /= 10;
	while (p != buf) pcu(*--p); }
void out(const char *s){while(*s)pcu(*s++);}
void out(char c){pcu(c);}
//void out(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail>
void out(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T>
//void out(vector<T> &v){for(T &x:v)out(' '),out(x);out('\n');}
//void out(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef svo

int main() {
	int a, rect = 0, rhombus = 0;
	while (scan(a)) {
		int b = in(), c = in();
		if (a * a + b * b == c * c)
			rect++;
		else if (a == b)
			rhombus++;
	}
	out(rect, '\n', rhombus, '\n');
}

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

using namespace std;

int main(){

  int in[3];
  char trash;
  int sumt = 0, sumh = 0;

  while(cin >> in[0] >> trash >> in[1] >> trash >> in[2]){


    if(in[2]*in[2] == in[0]*in[0] + in[1]*in[1]){
      sumt++;
    }else if(in[0] == in[1] || in[1] == in[2]){
      sumh++;
    }
  }

  cout << sumt << endl << sumh << endl;

  return 0;

}

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

using namespace std;

int main(int argc, char *argv[]) {
  int a,b,c;
  int rect = 0, diam = 0;
  while(scanf("%d,%d,%d", &a, &b, &c) != EOF) {
    if (c * c == a * a + b * b)
      rect++;
    else if (a == b)
      diam++;
  }

  cout << rect << endl;
  cout << diam << endl;
  return 0;
}

C++: #include<cstdio>

int chou=0;
int hisi=0;

int date_1,date_2,date_3;

int main()
{
	while(scanf("%d,%d,%d",&date_1,&date_2,&date_3)!=EOF)
	{
		if(date_1*date_1+date_2*date_2==date_3*date_3)chou++;
		else if(date_1==date_2)hisi++;
	}
	return 0;
}

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

bool isRectangle(int a, int b, int c);
bool isLozenge(int a, int b);

int main()
{
    int a;
    int b;
    int c;
    int rect_num = 0;
    int loze_num = 0;
    string in_str;
    while(getline(cin, in_str))
    {
        sscanf(in_str.c_str(),"%d,%d,%d",&a,&b,&c);
        if(isRectangle(a, b, c))
        {
            rect_num++;
        }
        if(isLozenge(a, b))
        {
            loze_num++;
        }
    }
    cout << rect_num << endl;
    cout << loze_num << endl;
    return 0;
}

bool isRectangle(int a, int b, int c)
{
    if(a * a + b * b == c * c)
    {
        return true;
    }
    else
    {
        return false;
    }
}

bool isLozenge(int a, int b)
{
    if(a == b)
    {
        return true;
    }
    else
    {
        return false;
    }
}

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

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

C++: #include <stdio.h>

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

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

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

C++: #include <iostream>
using namespace std;
 
int main(){
    int c = 0, h = 0;
    int s1, s2, t;
    char a, b;
    while(cin >> s1 >> a >> s2 >> b >> t)
   {
        if(((s1 * s1) + (s2 * s2)) == t * t) c++;
        if(s1 == s2) h++;
    }
    cout << c << endl;
    cout << h << endl;
    return 0;
}

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[10000][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][0] + a[i][1]*a[i][1] == a[i][2]*a[i][2]) rect++;
      else lozen++;
    }
    oss.clear(); oss.str("");
  }
  cout << rect << endl << lozen << endl;
  
  return 0;
}

C++: #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;


int main(){
    int sq=0,hi=0;
    int x[3];
    char hoge;
    while(cin>>x[0]>>hoge>>x[1]>>hoge>>x[2]){
        if(x[0]==0)break;
        if(x[0]*x[0]+x[1]*x[1]==x[2]*x[2])sq++;
        else
        if(x[0]==x[1])hi++;

    }
    cout<<sq<<endl<<hi<<endl;
    return 0;
}