题目名:成绩(无法提交)

This commit is contained in:
James 2020-04-27 11:45:14 +08:00
parent 1b9fc62755
commit 3efe13b1a7
8 changed files with 57 additions and 0 deletions

3
lg_numfenjie/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

View File

@ -0,0 +1 @@
#

44
lg_numfenjie/main.cpp Normal file
View 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

Binary file not shown.

1
lg_numfenjie/test/in.txt Normal file
View File

@ -0,0 +1 @@
999.99

View File

@ -0,0 +1 @@
123

View File

View 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