Files
ClassFeedback/C++代码/学习/未命名7.cpp

35 lines
499 B
C++

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main(){
// 拆位:短除法 1234 4321 %10
// 1234 1234 /1000 %1000 /100
int n, cnt = 1;
cin >> n;
// 先获得这个数的位数
int t = n;
while(t /= 10){
cnt *= 10;
}
cout << cnt;
// while(cnt){
// int f = n / cnt; // 得到第一位
//
// // 如果这个数是4 就改成8
// if(f == 4){
// f = 8;
// }
// cout << f;
//
// // 获得后面的几位数
// n %= cnt;
// cnt /= 10;
// }
return 0;
}