补全9月11日至13日课评:为13名学生创建请假文档,为5个班级创建总结文档
This commit is contained in:
34
C++代码/学习/未命名7.cpp
Normal file
34
C++代码/学习/未命名7.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user