fork download
  1. #include "iostream"
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned long long int t=0,n=0,temp=0;
  7. cin>>t;
  8. while(t--)
  9. {
  10. cin>>n;
  11. if(n<=9)
  12. cout<<n<<endl;
  13. else
  14. {temp=(n-1)/9;
  15. temp=n -(9*temp);
  16. cout<<temp<<endl;}
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 2684KB
stdin
Standard input is empty
stdout
Standard output is empty