高精度乘单精度其实很简单的
没压位的:
举个例子,12345*5
ans[]: 5 4 3 2 1
y:5
一变:25 4 3 2 1 x=0
------->5(25%10) 4 3 2 1 x=2(25/10)
二变:5 22 3 2 1 x=0
------->5 2(22%10) 3 2 1 x=2(22/10)
三变:5 2 17 2 1 x=0
------->5 2 7 2 1 x=1
四变:5 2 7 11 1 x=0
------->5 2 7 1 1 x=1
五变:5 2 7 1 6 x=0
------->5 2 7 1 6 x=0
结果变为:61725(倒过来便是答案)
注意,这时候的x可能会大于0,也就是说要进位!!!(997*233=232301)具体看代码
输出 printf("%05d",ans.a[i]);
如果有疑问的话:↙
戳着
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
struct node {
int len,a[5011];}ans,c;
node cheng(node a,int y)
{
c.len=a.len+2;
for (int i=