直接用数组模拟加法即可,希望能够帮助到你 include<stdio.h> include<string.h> void main(){ char a[1000],b[1000];int T,i,j,la,lb,max;scanf("%d",&T);getchar();for(i=1;i<=T;i++){ int c[1001]={0},a1[1000]={0},b1[1000]={0};scanf("%s",a);scanf("%s",b)...
40if(i>=mll&&a2.length()>a1.length()){41arr4[i]=(((int)arr3[i]-48)+flag)%10;42flag=(((int)arr3[i]-48)+flag)/10;43}44if(i==ml-1&&flag==1){//确定最高位是否为进位得到的145arr4[i+1]=1;46}4748}495051if(arr4[ml]==0){//最高位为0则不输出最高位,52reverse(arr4...
A + B Problem II(大数加法) 一直格式错误,不想改了,没A 1#include <iostream>2#include <stdio.h>3#include <string.h>4#include <stdlib.h>5usingnamespacestd;67intmain()8{9intT,K=0;10scanf("%d",&T);11chara[1002],b[1002];12intta[1002],tb[1002];13getchar();14while(T--)15{16...
A+B Problem (II) : Input/Output Pratice Time Limit: 1 Sec Memory Limit: 2 MBSubmit: 571 Solved: 431[Submit][Status][Web Board]Description 计算a+b,0<=a,b<1000。Input 输入的第一行是一个整数N,后面有N对整数a和b,每对a和b占一行,a,b用空格分开。Output 每行输出一个a+...
include<stdio.h> include<stdlib.h> int main(){ int a,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d\n",a+b);system("pause");return 0;} 应该是正确的。。。
将第一个for(;i>=0,j>=0;)改为for(;i>=0&&j>=0;)
int main(){ int t,i,len_str1,len_str2,len_max,k,num=1;char str1[1000];char str2[1000];scanf("%d",&t);getchar();while(t--){ int a[1000]={0},b[1000]={0},c[1001]={0};scanf("%s",str1);len_str1=strlen(str1);for( i=0;i<=len_str1-1;++i){ a[i...
2)A + B = SUM 之后要换行 方法一: #include<stdio.h>#include<string.h>voidReverse(char*,int);intmain(void){chara[1003]={0};charb[1003]={0};charc[1003]={0};intn=0;intl=0;intla=0;intlb=0;intx=0;intnum=1;intzeroid[2]={0};scanf("%d",&n);for(inti=0;i<n;i++){ze...
Problem Description Ihave a very simple problemforyou.Giventwo integersAand B,your jobisto calculate theSumof A+B. Input The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, ...
and all very necessit and also a learner and also believes and also developed a and also some problem and also very romanti and an angel and anemone and annual exports ab and another angel cam and another blue vodk and answering the que and anything else and appointed the lev and apprecia...