25 lines
433 B
C
25 lines
433 B
C
|
#include<stdio.h>
|
||
|
#include<stdlib.h>
|
||
|
#include<math.h>
|
||
|
|
||
|
int main(int argc, char * argv[]) {
|
||
|
|
||
|
float rayon;
|
||
|
|
||
|
printf("Veuillez indiquer le rayon de votre disque : ");
|
||
|
scanf("%f", &rayon);
|
||
|
|
||
|
for (int x = 0; x <= rayon*2; x++) {
|
||
|
for (int y = 0; y <= rayon*2; y++) {
|
||
|
double dist = sqrt(pow(x-rayon, 2.0) + pow(y-rayon, 2));
|
||
|
|
||
|
if (dist <= rayon) printf(" *");
|
||
|
else printf(" ");
|
||
|
}
|
||
|
printf("\n");
|
||
|
}
|
||
|
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|
||
|
|