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 <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	vector<int> a;
	while(cin>>n){
		if(n>=512){
			n-=512;
			a.push_back(512);
		}
		if(n>=256){
			n-=256;
			a.push_back(256);
		}
		if(n>=128){
			n-=128;
			a.push_back(128);
		}
		if(n>=64){
			n-=64;
			a.push_back(64);
		}
		if(n>=32){
			n-=32;
			a.push_back(32);
		}
		if(n>=16){
			n-=16;
			a.push_back(16);
		}
		if(n>=8){
			n-=8;
			a.push_back(8);
		}
		if(n>=4){
			n-=4;
			a.push_back(4);
		}
		if(n>=2){
			n-=2;
			a.push_back(2);
		}
		if(n==1){
			a.push_back(1);
		}
		sort(a.begin(),a.end());
		cout<<a[0];
		for(int i=1;i<a.size();i++){
			cout<<" "<<a[i];
		}
		cout<<endl;
		a.clear();
	}
	return 0;
}

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

int main(){
	int a[3],t,h;
	char d;
	t=h=0;
	for(int i=0;i<4;i++){
		cin>>a[0]>>d>>a[1]>>d>>a[2];
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])t++;
		else if(a[0]==a[1])h++;
	}
	cout<<t<<endl<<h<<endl;
}

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

int main(){

  int cnt_s, cnt_r, b[3];

  cnt_s = 0;
  cnt_r = 0;
  while(scanf("%d, %d, %d", &b[0], &b[1], &b[2]) != EOF){
    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++;
    }
  }

  cout << cnt_s << endl << cnt_r << endl;

  return 0;

}

C++: #include <cstdio>

using namespace std;

int main() {

	int a, b, c, ob=0, dia=0;

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

	printf("%d\n%d\n", ob, dia);

	return 0;

}

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

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;


int solve(int n, int sum, int amax) {
	if (n == 0) {
		if (sum == 0) {
			return 1;
		}
		else {
			return 0;
		}
	}
	else if (amax*n < sum ||0 * n>sum)return 0;
	else {
		int nans=0;
		for (int x =0; x <= amax; ++x) {
			nans+=solve(n-1,sum-x,x-1);
		}
		return nans;
	}
}


int main() {
	int a,b,c;
	int h=0,ch=0;
	while (scanf("%d,%d,%d",&a,&b,&c)!=-1) {
		vector<int>v{ a,b,c };
		sort(v.begin(),v.end());
		a=v[0];
		b=v[1];
		c=v[2];
		if(a==b)h++;
		if(a*a+b*b==c*c)ch++;
	}
	cout<<ch<<endl<<h<<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(z*z==x*x+y*y)N++;
else if(x==y)W++;
}
printf("%d\n%d\n",N,W);
return 0;
}

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

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

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<<endl;
	cout<<h<<endl;
	return 0;
}

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

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

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

int main()
{	
	int a, b, c, r = 0, s = 0;
	char d;

	while (cin >> a >> d >> b >> d >> c) {
		if (a * a + b * b == c * c)
			r++;

		if (a == b)
			s++;
	}

	cout << r << endl << s << endl;

	return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){
	
	int x=0,y=0;
	int a,b,c;
	char comma;
	while(cin>>a>>comma>>b>>comma>>c,a!=0){
		if(pow(a,2)+pow(b,2)==pow(c,2))
			x++;
		if(pow(a,2)-pow(double(c)/2,2)==pow(b,2)-pow(double(c)/2,2))
			y++;
	}
	
	cout<<x<<endl;
	cout<<y<<endl;
	
}

C++: #include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <cstdio>

using namespace std;



int main(){
	int a, b, c;
	int m = 0, n = 0;

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

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	char c;
	int T = 0, H = 0;
	for (int a, b, d; cin >> a >> c >> b >> c >> d;) {
		if (a*a + b*b == d*d)T++;
		else if (a == b)H++;
	}
	cout << T << endl << H << endl;
	return 0;
}

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

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
  
 int main()
 {
   int a,b,c;
   int arr[100005][3];
   int count1=0;
   int count2=0;
   int count=0;
   char temp,temp1;
   bool flag;
   while(cin>>a>>temp>>b>>temp1>>c)
   {
     flag=false;
     arr[count][0]=a;
     arr[count][1]=b;
     arr[count][2]=c;
     sort(arr[count],arr[count]+3);
     a=arr[count][0];
     b=arr[count][1];
     c=arr[count][2];
     count++;
       for(int i=0;i<count-1;i++)
       {
         if(a==arr[i][0]&&b==arr[i][1]&&c==arr[i][2])
         {
           flag=true;
           break;                                            
         }        
       }             
       if(!flag) 
       {
         if(a*a+b*b==c*c) count1++;
         else if(a==b) count2++;          
       } 
      //if(count==4) break;                               
   }
   cout<<count1<<endl;
   cout<<count2<<endl;  
   //while(1);     
   return 0;  
 }

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

using namespace std;
int main()
{
	vector<vector<int>> n;
	int ch = 0;
	int hisi = 0;
	int i, j,k,l = 0;
	while (scanf_s("%d,%d,%d",&i,&j,&k) != EOF) {
		vector<int>v;
		
		v.push_back(i);
		v.push_back(j);
		v.push_back(k);
		sort(&v[0], &v[2]);
		n.push_back(v);
		l++;
	}
	for (int a = 0; a < l; a++) {
		
		if ((n[a][0] ^ 2 )== ((n[a][1] ^ 2 )+ (n[a][2] ^2))) {
			if (!(n[a][0] == n[a][1] == n[a][2])) {
				ch++;
			}
		}
		else if ((n[a][0] == (n[a][1] || n[a][2])) || (n[a][1] == n[a][2])) {
			if (!(n[a][0] == n[a][1] == n[a][2])) {
				hisi++;
			}
		}
	}
	cout << ch << "\n" << hisi << endl;

	return 0;
}

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;
}