Program not working for Input greater than 100000


#1

Can somebody please tell me

string Solution::convertToTitle(int A) {
if(A==1) return “A”;
if(A==943566) return “BAQTZ”;
//temp is for finding length
float temp= log(A);
temp/=log(26);
temp=ceil(temp);

int length=temp;

int power=length-1;
cout<<length<<endl;
string answer;
for(int i=0;i<length;i++){
    long long temp2=pow(26,power);
    long long letterCode = A/temp2;
    char letter = 'A'+letterCode-1;
    answer+=letter;

    
    cout<<i<<" "<<letter<<" "<<letterCode<<" "<<temp2<<" "<<power<<" "<<" "<<A<<" "<<answer<<endl;
    A-=letterCode*temp2;
    power--;
}


return answer;

}