Please go through my code and let me know where I am going wrong. It gives correct output for majority numbers,but fails for some.

#include<bits/stdc++.h>

using namespace std;

int main()

{

ios_base::sync_with_stdio(false);

cin.tie(NULL);

int T;

cin>>T;

while(T–)

{

long long int n,t,a,c=0,i;

cin>>n;

t=n;

while(t>0)

{

c++;

t/=10;

}

for(i=1;i<=c;i++)

{

cout<<n;

a=n/pow(10,c-1);

n=n%(long int)pow(10,c-1);

n=n*10+a;

}

}

}