#include<stdio.h> #define MAX 1000000 int a[2][MAX], sum[MAX]; int main() { int n, i, k=0, m; scanf("%d",&n); for(i=0; i<n; i++) { scanf("%d",&a[0][i]); scanf("%d",&a[1][i]); } for(i=n-1; i>=0; i--) { m = a[0][i] + a[1][i] + k; sum[i] = m %10; k = m /10; } for(i=0; i<n; i++) { printf("%d", sum[i]); } printf("/n"); return0; }
大数加法#include#define MAX 1000000int a[2][MAX], sum[MAX];int main(){ int n, i, k=0, m; scanf("%d", &n); for(i=0; in; i++) { scanf("%d", &a[0][i]); scanf("%d", &a[1][i]);