Why is this solution wrong?(for YVNUM[December Cookoff)]

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;
}
}
}

|n| is of the order 10^5. You can’t store this big number in long long int. Try using a string to store the input number.

|n| is of the order of 10^5 as kshitij_07 pointed out. It means n < 10^{10^5}