#include<iostream> #include<vector> using namespace std; int main() { vector<int> v; int a; cin >> a; if (a >= 100 && a <= 999){ int b = a; while (b > 9) { b = b / 10; b = a - b * 10; v.push_back(b); b = a/10; a = b; } v.push_back(b); for (vector<int>::iterator it=v.begin();it!=v.end();it++) { cout << *it; } } else cout << "输入有误,请重新输入!"; }
全部评论
(0) 回帖