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,c1); n=n%(long int)pow(10,c1); n=n*10+a; } } } asked 24 Dec '18, 13:03

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. answered 24 Dec '18, 13:14

n is of the order of 10^5 as kshitij_07 pointed out. It means $n < 10^{10^5}$ answered 24 Dec '18, 13:49
