HDOJ_1002
Posted phalq
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDOJ_1002相关的知识,希望对你有一定的参考价值。
AC代码:
#include <iostream> #include <cstdio> #include <cstring> #define Max 1050 using namespace std; void hanshu(char *s1,char *s2,char *s); int main(void) { freopen("in.txt","r",stdin); int T,count=0; char s1[Max],s2[Max],s[Max]; scanf("%d",&T); while(T--) { scanf("%s%s",s1,s2); hanshu(s1,s2,s); count++; if(T!=0) printf("Case %d: %s + %s = %s ",count,s1,s2,s); else printf("Case %d: %s + %s = %s ",count,s1,s2,s); } fclose(stdin); return 0; } void hanshu(char *s1,char*s2,char *s) { int length1=strlen(s1),length2=strlen(s2),length; if(length1>length2) length=length1; else length=length2; s[length+1]=‘