Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() {
- long a,l=0,len,i,p;
- char ar[1000],z;
- scanf("%ld",&a);
- for(i=0; a>0; i++) {
- if(a>26) {
- if(a%26==0) {
- z='Z';
- a=(a/26)-1;
- } else {
- z='A'+(a%26)-1;
- a=a/26;
- }
- ar[i]=z;
- } else if(a<=26) {
- z='A'+a-1;
- ar[i]=z;
- break;
- }
- }
- len=strlen(ar);
- for(i=0; i<len; i++) {
- printf("%c",ar[len-1-i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement