2011阿里巴巴程序设计公开赛 1003 I'll play a trick on you
2011-08-18 20:34
477 查看
发现规律题目:各个数的各位相加推出第三个数
且注意是大数的问题
源代码:
且注意是大数的问题
源代码:
#include <iostream> using namespace std; #define LEN 101 char num1[LEN]; char num2[LEN]; int a[LEN]; int b[LEN]; int result[LEN]; int main(){ int i,j; int t; cin>>t; for(j=1;j<=t;j++){ scanf("%s%s",num1,num2); int len1=strlen(num1); int len2=strlen(num2); int len=len1+len2; int sum=0; for(i=0;i<len1;i++){ a[i]=num1[i]-'0'; sum+=a[i]; } for(i=0;i<len2;i++){ b[i]=num2[i]; sum+=b[i]-'0'; } printf("Case %d: %d\n",j,sum); } return 0; }
相关文章推荐
- 2011阿里巴巴程序设计公开赛 / 1003 I'll play a trick on you
- 2011阿里巴巴程序设计公开赛 / 1003 I'll play a trick on you
- 2011 Alibaba Programming Contest_1003_I'll play a trick on you
- I'll play a trick on you(2011 Alibaba Programming Contest)
- 南阳oj 400 I'll play a trick on you (细节规律题 简单的字符串处理)
- 2011阿里巴巴程序设计公开赛 1001 Coin Game
- ACM_ I'll play a trick on you
- 2011阿里巴巴程序设计公开赛 / 1001 Coin Game
- 2011阿里巴巴程序设计公开赛 总结(by胡浩)
- 2011阿里巴巴程序设计公开赛 / 1001 Coin Game
- HDu--3935(I'll play a trick on you)
- 2011阿里巴巴程序设计公开赛 / 1002 Fruit Ninja
- HDU 3952 2011阿里巴巴程序设计公开赛
- 2011阿里巴巴程序设计公开赛 / 1002 Fruit Ninja
- 2011阿里巴巴程序设计公开赛 / 1004 Level up
- 2011阿里巴巴程序设计公开赛 / 解题报告 8.18
- 2011阿里巴巴程序设计公开赛 / 1004 Level up
- I'll play a trick on you
- NYOJ 题目400 I'll play a trick on you
- 2011阿里巴巴程序设计公开赛 / 解题报告 8.18