
Untitled
By: a guest on
Aug 2nd, 2012 | syntax:
C | size: 0.40 KB | hits: 13 | expires: Never
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int a,b,r,i,h,d=0;
printf("Podaj poczatek przedzialu:\n");
scanf("%d",&a);
printf("Podaj koniec przedzialu:\n");
scanf("%d",&b);
printf("Podaj promien:\n");
scanf("%d",&r);
for(i=a;i<b;i++)
{
for(h=a;h<b;h++)
{
if(sqrt(i*i+h*h)<r)
d++;
}
}
printf("Liczba par: %d\n",d);
system("pause");
}