#include #include #include int main(int argc, char ** argv) { if (argc != 1+4) { fprintf(stderr, "uporaba: %s \nprimer: %s 1000 1 100 1\n", argv[0], argv[0]); return 1; } unsigned int i; double j[3]; double n[1]; double min = atoi(argv[2]); double max = atoi(argv[3]); double step = atoi(argv[4]); for (i = 1; i <= 1; i++) n[i-1] = atof(argv[i]); for (j[0] = min; j[0] <= max; j[0]++) for (j[1] = min; j[1] <= max; j[1]++) for (j[2] = min; j[2] <= max; j[2]++) if ((j[0] < j[1] < j[2]) && (j[0] + j[1] + j[2] == n[0]) && (pow(j[0],2) + pow(j[1],2) == pow(j[2],2))) fprintf(stdout, "naĊĦel: %f^2 + %f^2 = %f^2 ; %f+%f+%f=%f\n", j[0],j[1], j[2], j[0], j[1], j[2], j[0]+j[1]+j[2]); return 0; }