安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

C++ 判断回文数:3 位数回文判定

  • 日期: 2025-04-25
  • 标签: 常规
#include <iostream>
using namespace std;

int main() {
    int num;
    cin >> num;
    
    int digit1 = num / 100; // 百位数
    int digit3 = num % 10; // 个位数
    
    if (digit1 == digit3) {
        cout << 'YES' << endl;
    } else {
        cout << 'NO' << endl;
    }
    
    return 0;
}
C++ 判断回文数:3 位数回文判定

原文地址: https://www.cveoy.top/t/topic/plEH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: Autodesk Inventor 宏:将零部件激活光源样式更改为'两个光源'
  • 下一篇: 论文图片放置:附录与正文中的图表使用

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2