Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #define INF 2000000000
- #define fiMAX(x,y) (x>y?x:y)
- #define fiMIN(x,y) (x>y?y:x)
- /*
- IN : 4
- OUT :
- * *
- ** **
- *** ***
- ********
- *** ***
- ** **
- * *
- */
- int main()
- {
- int N;
- int i,j,k;
- int L,R;
- scanf("%d",&N);
- L=1;
- R=N*2;
- for(i=1; i<=N*2-1; i++)
- {
- for(j=1; j<=N*2; j++)
- {
- if(i<=N)
- {
- if(j<=L || R<=j) printf("*");
- else printf(" ");
- }
- else
- {
- if(j>L || R>j) printf("*");
- else printf(" ");
- }
- }
- L++;
- R--;
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement