SH127 @ 2024-08-06 16:47:07
by Metro_Line5 @ 2024-08-06 16:48:13
木更 百 禾斗 : 这叫“厌氧”
by 11514zbs @ 2024-08-06 16:55:43
@SH127 把你的Code(代码)交出来
by masonxiong @ 2024-08-06 16:56:19
@SH127 那大概率是您的程序出现了 UB 即未定义行为
by SH127 @ 2024-08-06 18:22:37
@11514zbs
#include<string.h>
#define LEN 100
int main()
{
int num[100]={0},sum[100]={0},n;
scanf("%d",&n);
num[0]=1;
for(int i=1;i<=n;i++){
int carry=0;
for(int j=0;j<LEN;j++){
int p=num[j]*i+carry;
carry=p/10;
num[j]=p%10;
}
/*for(int i=0;i<10;i++){
printf("%d",num[i]);
}
printf("\n");*/
int y=0;
for(int j=0;j<LEN;j++){
int q=num[j]+sum[j]+y;
y=q/10;
sum[j]=q%10;
}
/*for(int i=0;i<10;i++){
printf("%d",sum[i]);
}
printf("\n");*/
}
int i=0;
for(i=LEN;i>0;i--){
if(sum[i]!=0) break;
}
for(int j=i;j>=0;j--){
printf("%d",sum[j]);
}
return 0;
}```
by 11514zbs @ 2024-08-06 19:05:10
@SH127 I don't know.
by ericdan666 @ 2024-08-08 21:00:04
O2好像是吧某些东西拆开计算,我也有过