Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5.  
  6. int num,i,j,k;
  7. int am,fr;
  8.  
  9. scanf("%d",&num);
  10.  
  11. while(num--){
  12.  
  13. scanf("%d",&am);
  14. scanf("%d",&fr);
  15.  
  16. while(fr--){
  17.  
  18. for(i = 1;i <= am;i++){
  19.  
  20. j=i;
  21. while(j--)
  22. printf("%d",i);
  23.  
  24. printf("\n");
  25. }
  26.  
  27. for(i = am-1;i > 0;i--){
  28.  
  29. j=i;
  30. while(j--)
  31. printf("%d",i);
  32.  
  33.  
  34. printf("\n");
  35. }
  36. if(fr)
  37. printf("\n");
  38. }
  39. if(num)
  40. printf("\n");
  41.  
  42. }
  43.  
  44.  
  45.  
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement