Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- int main()
- {
- int rows,i,j,waves,a;
- scanf("%d%d",&rows,&waves);
- for(a=1;a<=waves ;a++)
- {
- for(i=1;i<=rows;i++)
- {
- for(j=1;j<=i;j++)
- {
- printf("%d ",i);
- }
- printf("\n");
- }
- for(i=rows-1;i>=1;i--)
- {
- for(j=1;j<=i;j++)
- {
- printf("%d ",i);
- }
- printf("\n");
- }
- printf("\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment