这 位 更 是 重 量 级
2024-08-13 16:14:40
发布于:湖南
71阅读
0回复
0点赞
高精除高精👍
#include <iostream>
#include <cstring>
#define cjdst_is_a_renji std
#define xiugaineicun memset
#define shuru cin
#define shuchu cout
#define sanshierzhengxing int
#define shiliuzhengxing short
#define bazhengxing char
#define fanhui return
#define ruguo if
#define chongfuxunhuan for
#define yizhixunhuandao while
#define qiudaxiao sizeof
#define ling 0
#define yi 1
#define yiqianlingwu 1005
#define shi 10
bazhengxing chao[yiqianlingwu], ji[yiqianlingwu];
sanshierzhengxing da[yiqianlingwu], shuai[yiqianlingwu], tong[yiqianlingwu], beiyongshuzu[yiqianlingwu];
sanshierzhengxing bijiaodaxiao(sanshierzhengxing *a, sanshierzhengxing *b){
ruguo(a[ling] < b[ling]) fanhui -yi;
ruguo(a[ling] > b[ling]) fanhui yi;
chongfuxunhuan(sanshierzhengxing i = a[ling]; i >= yi; i--){
ruguo(a[i] > b[i]) fanhui yi;
ruguo(a[i] < b[i]) fanhui -yi;
}fanhui ling;
}sanshierzhengxing youduiqihanshu(sanshierzhengxing *a, sanshierzhengxing *b, sanshierzhengxing dst){
chongfuxunhuan(sanshierzhengxing i = yi; i <= a[ling]; i++){
b[i + dst - yi] = a[i];
}b[ling] = a[ling] + dst - yi;
}
sanshierzhengxing main(){
cjdst_is_a_renji::shuru >> chao >> ji;
da[ling] = strlen(chao), shuai[ling] = strlen(ji);
chongfuxunhuan(sanshierzhengxing i = ling; i < da[ling]; i++) da[da[ling] - i] = chao[i] - '0';
chongfuxunhuan(sanshierzhengxing i = ling; i < shuai[ling]; i++) shuai[shuai[ling] - i] = ji[i] - '0';
ruguo(bijiaodaxiao(da, shuai) == -yi){
cjdst_is_a_renji::shuchu << ling << cjdst_is_a_renji::endl << chao;
fanhui ling;
}
tong[ling] = da[ling] - shuai[ling] + yi;
chongfuxunhuan(sanshierzhengxing i = tong[ling]; i >= yi; i--){
xiugaineicun(beiyongshuzu, ling, qiudaxiao(beiyongshuzu));
youduiqihanshu(shuai, beiyongshuzu, i);
yizhixunhuandao(bijiaodaxiao(da, beiyongshuzu) >= ling){
tong[i]++;
chongfuxunhuan(sanshierzhengxing j = yi; j <= da[ling]; j++){
ruguo(da[j] < beiyongshuzu[j]){
da[j + yi]--;
da[j] += shi;
}da[j] -= beiyongshuzu[j];
}yizhixunhuandao(da[da[ling]] == ling && da[ling] > yi) da[ling]--;
}
}yizhixunhuandao(tong[ling] > yi && tong[tong[ling]] == ling) tong[ling]--;
chongfuxunhuan(sanshierzhengxing i = tong[ling]; i > ling; i--) cjdst_is_a_renji::shuchu << tong[i];
cjdst_is_a_renji::cout << cjdst_is_a_renji::endl;
chongfuxunhuan(sanshierzhengxing i = da[ling]; i > ling; i--) cjdst_is_a_renji::shuchu << da[i];
fanhui ling;
}
全部评论 5
2024-08-13 来自 上海
0我的至少还有一点点观赏性(不是
2024-09-15 来自 广东
0能看懂
2024-09-20 来自 上海
0
老乡回去了
2024-07-24 来自 广东
0hh
2024-07-24 来自 湖南
0爽
2024-07-24 来自 广东
0
我内个都
2024-07-24 来自 广东
0更适合中国宝宝体质的C++
2024-07-24 来自 湖南
0而且数据有误,输出应为商与余数两行
2024-07-24 来自 湖南
0
有帮助,赞一个