shamiul93

Untitled

Oct 14th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std ;
  3.  
  4. int main()
  5. {
  6.     long long int test , N , i ;
  7.     cin >> test ;
  8.     while(test--)
  9.     {
  10.         cin >> N ;
  11.         if(N>=0)
  12.         {
  13.             for(i=0 ; i<= N ; i++)
  14.             {
  15.                 cout << i  ;
  16.                 if(i!=N) cout << " ";
  17.  
  18.             }
  19.         }
  20.         else
  21.         {
  22.             for(i=N ; i<=0 ; i++)
  23.             {
  24.                 cout << i  ;
  25.                 if(i!=0) cout << " ";
  26.             }
  27.         }
  28.         cout << endl ;
  29.     }
  30.     return 0 ;
  31. }
Add Comment
Please, Sign In to add comment