らての精進日記

修行をします

aoj0032:Plastic Board

解法

三平方の定理が成り立っていれば長方形、2本の辺の長さが等しければひし形。

コード

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

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

    printf("%d\n%d\n",x,y);
    
    return 0;
}