#include <stdio.h> #include <math.h> #define N 7 #define PI 3.1415926 int main() { int x, y; for(y = 0; y >= -2*N; y--) { for(x = 0; x <= 2*N; x++) { if(fabs(y - N*(-1-sin(PI*x/N))) <= 1.1) printf("* "); else printf(" "); } printf("\n"); } getchar(); return 0; }
#include <stdio.h> int main(){ printf("* * * * * * * * * *\n"); printf(" \n"); printf("* * * *\n"); printf(" \n"); printf("* * * * * * * * * *\n"); getchar(); return 0; }