MY name is ruhul amin

ISLAMIC UNIVERSITY OF KUSHTIA

Sunday, May 12, 2013

codeforces contest program

#include <iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<queue>
using namespace std;
class name
{
    int p;
    int q,m;
    int r,c;
    public:
    void member(int n);
};
void name::member(int n)
{
    c=0;
    for(int i=1;i<n;i++)
    {
        for(int j=i;j<n;j++)
        {
            r=i*i+j*j;
            p=int(sqrt(i*i+j*j));
            q=p*p;
            if(r>n*n)
            break;
            if(r==q)
            {
            c=c+1;
            }
        }
    }
    cout<<c<<endl;
}
int main()
{
    int a;
    name ob;
    while(cin>>a)
    {
        ob.member(a);
    }
    return 0;
}

1 comment: