Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std ;
- int main()
- {
- long long int test , N , i ;
- cin >> test ;
- while(test--)
- {
- cin >> N ;
- if(N>=0)
- {
- for(i=0 ; i<= N ; i++)
- {
- cout << i ;
- if(i!=N) cout << " ";
- }
- }
- else
- {
- for(i=N ; i<=0 ; i++)
- {
- cout << i ;
- if(i!=0) cout << " ";
- }
- }
- cout << endl ;
- }
- return 0 ;
- }
Add Comment
Please, Sign In to add comment