OJ笔记——又是A+B
2020/05/07
OJ笔记——又是A+B
每天进步亿点点
Problem Description
嗯,出题的脑子反了,所以所有数字都反过来写了,不过,还是要你计算原来的A+B结果。
Input
两个反过来的数字,A,B。int32整数范围。
Output
原来那个A+B
Sample Input
1436 23965
27005 22010
11326 18446
20552 24176
Sample Output
63273
51094
126792
92644
C代码实现
// An highlighted block
#include <stdio.h>
#include <stdlib.h>
#include <string.h>int main()
{int num_x,num_y,i,sum,len_a,len_b;char a[100],b[100],x[100],y[100];while(scanf("%s %s",a,b)!=EOF){len_a=strlen(a);len_b=strlen(b);for(i=0;i<len_a;i++){x[len_a-1-i]=a[i];}for(i=0;i<len_b;i++){y[len_b-1-i]=b[i];}num_x=atoi(x); num_y=atoi(y);printf("%d\n",num_x+num_y);}return 0; }
运行结果是对的但是oj没有通过,不知为何
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
