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