DEV/BUT1/DEV1.1/revision/cercle.c
2024-02-01 13:55:03 +01:00

23 lines
416 B
C

#include <stdlib.h>
#include <stdio.h>
int main() {
int rayon;
int i, j;
printf("Rayon ? ");
scanf("%d", &rayon);
for (i = -rayon; i <= rayon; i++) {
for (j = -rayon; j <= rayon; j++) {
if (i * i + j * j <= rayon * rayon) {
printf("* ");
} else {
printf(" ");
}
}
printf("\n");
}
return 0;
}