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...
杭电1002-A + B Problem II #include<stdio.h> #include<string.h> int main() { char str1[1001],str2[1001]; int t,i,maxlen,len1,len2,k,num=1; scanf("%d",&t); getchar(); while(t--) { int a[1001]={0},b[1001]={0},c[1001]={0}; scanf("%s",str1); len1=strlen(...
int main() { int i,T,k,lmax,a[1010],b[1010],sum[1010]; char x[1010],y[1010]; scanf("%d",&T); for(i=0; i<T; i++) { memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); memset(x,0,sizeof(x)); memset(y,0,sizeof(y)); memset(sum,0,sizeof(sum)); scanf("%s ...
杭电acm 1002 (A+B Problem II) #include<iostream> #include<string> using namespace std; int main() { int T; string s1,s2,temp; cin>>T; if(T>20||T<0) return 0; for(int i=0;i<T;i++) { cin>>s1>>s2; cout<<"Case "<<i+1<<":"<<"\n"<<s1<<" + "<<s2<<" = ...
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, each line consists of two positive integers, A and B. Notice...
#include<stdio.h>#include<string.h>voidSum(char a[],char b[],int c[],int lena,int lenb);intmain(void){char a[1000]={0},b[1000]={0};int c[1001]={0};int number,i,j,lena,lenb,max;scanf("%d",&number);for(i=0;i<number;i++){/***初始化***/char a[1000]={0};char...
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]=str1[len_str1-1-i]-'0';//将字符转换为整型;} scanf("%s",str2);len_str2=strlen(str2);for( i=0;i<=len_str2-1;++i){ b[i]...
A == B ?(杭电2054) A == B ? Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 64239 Accepted Submission(s): 10060 Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES", or print "...
杭电ACM 1096(A+B for Input-Output Practice (VIII)) 杭电ACM 1095(A+B for Input-Output Practice (VII)) 杭电ACM 1094 (A+B for Input-Output Practice (VI)) 杭电ACM 1093(A+B for Input-Output Practice (V)) A+B for Input-Output Practice (II) 杭电acm 1002 (A+B Problem II) 杭电ACM ...
杭电oj:A + B Problem II java实现 A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 474597 Accepted Submission(s): 91595 Problem Description I have a very simple problem for you. Given two integers A and B, your ...