mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-07 18:06:58 +08:00
添加了许多代码文件
This commit is contained in:
25
#127. 分离整数的各个数.cpp
Normal file
25
#127. 分离整数的各个数.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a,b,c=0,d[10000],i=0;
|
||||
cin >>a;
|
||||
b=a;
|
||||
while(a){
|
||||
a/=10;
|
||||
c++;
|
||||
}
|
||||
while(b){
|
||||
d[i]=b%10;
|
||||
b/=10;
|
||||
i++;
|
||||
}
|
||||
for(int i=0;i<c;i++){
|
||||
cout <<d[i]<<" ";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user