Advertisement
llvlleo1810

Dạng bài tập về vẽ hình bằng số

Apr 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. INPUT
  2. 5
  3. OUTPUT
  4. 1 2 3 4 5
  5. 6 7 8 9 10
  6. 11 12 13 14 15
  7. 16 17 18 19 20
  8. 21 22 23 24 25
  9. ----------------------
  10. #include <stdio.h>
  11.  
  12. int main(){
  13.     int n;
  14.     scanf("%d",&n);
  15.     int t=1;
  16.     for(int i=1;i<=n;i++){
  17.         for(int j=1;j<=n;j++){
  18.             printf("%d" ,t++);
  19.         }
  20.         printf("\n");
  21.     }
  22.    
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement