题目描述:输入一个整数,将其倒序输出为一个字符串。例如输入整数9635,则输出字符串为5369
输入描述:输入一个整数
输出描述:输出其倒序的字符串
输入样例:12345
输出样例:54321
算法实现:
#include<iostream>using namespace std;//************************************************ // * Author: 赵志乾 // * Date: 2017-2-18 // * Declaration: All Rigths Reserved !!! //***********************************************/int main(){ int indata; cin>>indata; while(indata!=0) { cout<<indata%10; indata/=10; } cout<<endl; return 0;}
新闻热点
疑难解答