【蓝桥杯】Excel地址

一.题目描述

 

 

二.问题分析

类似于进制转换

//Excel地址
#include <iostream>
#include <stack>
using namespace std;

//const int N=1e2+2;
long long n;
stack <char> s;

int main(int argc, const char * argv[]) {
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n;
    while(n>0){
        n--;
        s.push(n%26+'A');
        n/=26;
    }
    
    while(!s.empty()){
        cout<<s.top();
        s.pop();
    }
    cout<<'\n';
    return 0;
}

相关推荐

  1. 官网练习题(Excel地址

    2024-03-10 13:00:02       29 阅读
  2. P8738 [ 2020 国 C] 天干地支

    2024-03-10 13:00:02       31 阅读
  3. 贪心+

    2024-03-10 13:00:02       44 阅读
  4. 简介

    2024-03-10 13:00:02       33 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-10 13:00:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-10 13:00:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-10 13:00:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-10 13:00:02       18 阅读

热门阅读

  1. MyBatis和MyBatis-Plus的差别和优缺点

    2024-03-10 13:00:02       22 阅读
  2. Jetty的ssl模块

    2024-03-10 13:00:02       22 阅读
  3. Linux的环境安装以及项目部署

    2024-03-10 13:00:02       20 阅读
  4. WPF Interaction

    2024-03-10 13:00:02       21 阅读
  5. 当Github启用PSA之后...

    2024-03-10 13:00:02       18 阅读