Cod sursa(job #914594)

Utilizator MuresanCristianMuresan Cristian MuresanCristian Data 14 martie 2013 11:57:42
Problema Poligon Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.79 kb
#include <fstream>
using namespace std;
ifstream is("poligon.in");
ofstream os("poligon.out");

int n;
int r[1001];

struct Coord{
    int x;
    int y;
};

Coord q[1001];
int main()
{
    is >> n;
    for(int i = 1; i <= n; ++i)
        is >> r[i];
    int cnt = 0;
    for(int i = 1; i <= n; ++i)
        {
            for(int j = 1; j <= r[i]; ++j)
            {
                for(int z = j; z <= r[i]; ++z)
                {
                    if(j * j + z * z == r[i] * r[i])
                    {
                        q[cnt].x = j;
                        q[cnt].y = z;
                        cnt++;
                    }
                    if()
                }
            }
        }

    os << cnt * 2;
    is.close();
    os.close();
    return 0;
}