Advertisement
Guest User

1145 logical sequence 2

a guest
Mar 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     int i, n, x, counter=0;
  6.  
  7.     scanf("%d %d", &n, &x);
  8.  
  9.     if (n>1 && n<20 && x>n && x<100000)
  10.     {
  11.         if(n < x)
  12.         {
  13.             for(i=1; i<=x; i++)
  14.             {
  15.                 printf("%d ", i);
  16.                 counter++;
  17.  
  18.                 if(counter==n)
  19.                 {
  20.                     printf("\n");
  21.                     counter=0;
  22.                 }
  23.             }
  24.             printf("\n");
  25.         }
  26.     }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement