题目名:成绩(无法提交)
This commit is contained in:
parent
1b9fc62755
commit
3efe13b1a7
3
lg_numfenjie/Readme.md
Normal file
3
lg_numfenjie/Readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
1
lg_numfenjie/doc/Readme.md
Normal file
1
lg_numfenjie/doc/Readme.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
#
|
44
lg_numfenjie/main.cpp
Normal file
44
lg_numfenjie/main.cpp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#include<iostream>
|
||||||
|
#include<cstdio>
|
||||||
|
#include<cstring>
|
||||||
|
using namespace std;
|
||||||
|
int main(){
|
||||||
|
int qian=-1,hou=0,now;
|
||||||
|
char tou[2000],wei[2000],a[4000];
|
||||||
|
bool ce=0;
|
||||||
|
while(cin>>a[++now]){
|
||||||
|
if(ce==1){
|
||||||
|
hou++;
|
||||||
|
wei[hou]=a[now];
|
||||||
|
}
|
||||||
|
if(a[now]=='.'){
|
||||||
|
ce=1;
|
||||||
|
}
|
||||||
|
if(ce==0){
|
||||||
|
qian++;
|
||||||
|
tou[qian]=a[now];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("%c*",tou[0]);
|
||||||
|
for(int j=1;j<qian;j++){
|
||||||
|
printf("0");
|
||||||
|
}
|
||||||
|
for(int i=1;i<=qian;i++){
|
||||||
|
if(tou[i]!='0'){
|
||||||
|
printf("+%c*1",tou[i]);
|
||||||
|
for(int j=1;j<=qian-i;j++){
|
||||||
|
printf("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(int i=1;i<=hou;i++){
|
||||||
|
if(wei[i]!='0'){
|
||||||
|
printf("+%c*0.",wei[i]);
|
||||||
|
for(int j=1;j<=qian-i;j++){
|
||||||
|
printf("0");
|
||||||
|
}
|
||||||
|
printf("1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
lg_numfenjie/main.exe
Normal file
BIN
lg_numfenjie/main.exe
Normal file
Binary file not shown.
1
lg_numfenjie/test/in.txt
Normal file
1
lg_numfenjie/test/in.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
999.99
|
1
lg_numfenjie/test/in2.txt
Normal file
1
lg_numfenjie/test/in2.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
123
|
0
lg_numfenjie/test/in3.txt
Normal file
0
lg_numfenjie/test/in3.txt
Normal file
7
lg_numfenjie/test/out.txt
Normal file
7
lg_numfenjie/test/out.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
## z:\Chao\src\Template\test\in.txt
|
||||||
|
2020/03/14 ÖÜÁù 11:41:28.68
|
||||||
|
Hello Easy C++ project!
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
Process exited after 200 ms with return value 0
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user