整数拆段(未完成)
This commit is contained in:
parent
ef43e42fd4
commit
0b327c4df4
16
1670_chaishu/Readme.md
Normal file
16
1670_chaishu/Readme.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# 1670 『入门』(递归专题)整数拆段
|
||||||
|
|
||||||
|
[问题描述]
|
||||||
|
将一个位数为L(4≤L≤10)的自然数N拆成4段,使各段对应的数的乘积最小。你能编一个程序实现吗?
|
||||||
|
|
||||||
|
[输入格式]
|
||||||
|
一个自然数N。
|
||||||
|
|
||||||
|
[输出格式]
|
||||||
|
一个整数,最小乘积。
|
||||||
|
|
||||||
|
[输入样例]
|
||||||
|
321427
|
||||||
|
|
||||||
|
[输出样例]
|
||||||
|
2268
|
1
1670_chaishu/doc/Readme.md
Normal file
1
1670_chaishu/doc/Readme.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
#
|
21
1670_chaishu/main.cpp
Normal file
21
1670_chaishu/main.cpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
int ans=0,nowans=1;
|
||||||
|
void xiao(int now,int duan){
|
||||||
|
if(duan==1){
|
||||||
|
if(ans==0||nowans<ans){
|
||||||
|
ans=nowans;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for(int i=10;;i*=10){
|
||||||
|
if(now)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
cin>>n;
|
||||||
|
xiao(n,4);
|
||||||
|
}
|
BIN
1670_chaishu/main.exe
Normal file
BIN
1670_chaishu/main.exe
Normal file
Binary file not shown.
0
1670_chaishu/test/in.txt
Normal file
0
1670_chaishu/test/in.txt
Normal file
0
1670_chaishu/test/in2.txt
Normal file
0
1670_chaishu/test/in2.txt
Normal file
0
1670_chaishu/test/in3.txt
Normal file
0
1670_chaishu/test/in3.txt
Normal file
7
1670_chaishu/test/out.txt
Normal file
7
1670_chaishu/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