1295A - Display The Number

1295A - Display The Number


  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int t;
  6. int n;
  7. cin>>t;
  8. while(t--)
  9. {
  10. cin>>n;
  11. if(n%2==0){
  12. for(int i=0;i<n/2;i++)
  13. cout<<1;
  14. cout<<endl;
  15. }
  16. else{
  17. cout<<7;
  18. for(int i=1;i<n/2;i++)
  19. cout<<1;
  20. cout<<endl;
  21. }
  22. }
  23.  
  24.  
  25.  
  26.  
  27. }

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

1535A. Fair Playoff

Aptitude test assistant programmer 2018