CE求调,请管理员来看一下
查看原帖
CE求调,请管理员来看一下
1487937
Leo_liu_zi_su楼主2025/1/21 21:01

请问为什么洛谷ide和DEV6.3试代码都没CE,

为什么试题目就CE了?
题目:P1601A+B Problem(高精)

代码:

#include<bits/stdc++.h>
using namespace std;
int main(){
	char A[10001],B[10001];
	int C[10002];
	int n;
	gets(A);
	gets(B);
	n=max(strlen(A),strlen(B));
	for(int i=0;i<n;i++){
		C[i]=0;
	}
	for(int i=0;i<n;i++){
		C[i]+=(A[i]-'0')+(B[i]-'0');
		if(C[i]>=10){
			C[i+1]++;
		}
	}
	if(C[n]>=10){
		C[n+1]++;
	}
	for(int i=0;i<n;i++){
		cout<<C[i];
	}
	return 0;
}

求回复

2025/1/21 21:01
加载中...