数字颠倒

来源:互联网 发布:淘宝客新手怎么推广 编辑:程序博客网 时间:2024/04/25 08:04

点击打开链接

#include<iostream> #include<string>using namespace std;void main(){int n,t,i=0;cin >> n;char s[100];while (n != 0){t = n % 10;n = n / 10;s[i++] =t+'0';//将整数赋值给字符}s[i] = '\0';cout << s << endl;system("pause");}


0 0
原创粉丝点击