(0人评价)
UE4 C++ 学习路线(上):标准C++
价格 ¥ 2998.00
该课程属于 零基础学虚幻4(UE4)·全系列 请加入后再学习

#include<iostream>
using namespace std;
int main()
{
    int num = 0;
    int temp = 0;
    int temp2 = 0;
    int temp3 = 0;
    cout << "请输入一个两位数" << endl;
    cin >> num;
    if (num < 100)
    {    
        temp = (num % 10 == 0 ? 0 : num % 10) * 10 + num / 10;            
        cout << num << " 翻转数为 " << temp << endl;
    }
    else 
    {
        temp2 = num / 100;
        temp2 = temp2 * 100;
        temp3 = num - temp2;
        temp = ((temp3 % 10 == 0 ? 0 : temp3 % 10) * 10 + temp3 / 10 )*10+ num / 100;
        cout << num << " 翻转数为 " << temp << endl;
    }
    system("pause");
    return 0;
}

[展开全文]