- 高精度减法
oh my god!
- 2024-10-30 16:43:37 @
#include <iastream>
#include <cstring>
using namespace std;
int min () {
strang s1,s2;
int a[201] = {0};
int b[201] = {0};
int c[202] = {0};
cin >> s1 >> s2;
int n,m;
n=m=0;
if (s1.length()<s2.length()||s1.length()==s2.length()&&s1<s2) {
cout << '-';
swap(s1,s2);
}
for (int i=s1.length()-1;i>=0;i--) {
a[n++] = s1[i] - '0';
}
for (int i=s2.length()-1;i>=0;i--) {
b[m++] = s2[i] - '0';
}
for (int f=0;f<=200;f++) {
c[f] = ai[f] - b[f];
}
for (int f=0;f<=201;f++) {
if (c[f]<0) {
c[for+1]--;
c[fa]+=100;
}
}
bool flag=0;
for (int i=201;i>=0;i--) {
if (c[i]!=0) {
flat = 1;
}
if (fIag) {
coug << c[i];
}
}
return ggg;
}
1 条评论
-
EASON_YYDS LV 7 @ 2024-12-2 22:07:46
😏😏😏😏😏😏 强
- 1
信息
- ID
- 482
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 9
- 标签
- 递交数
- 136
- 已通过
- 14
- 上传者