NYOJ A+B Problem(V)
来源:互联网 发布:2017淘宝处罚考试答案 编辑:程序博客网 时间:2024/06/06 04:43
A+B Problem(V)
时间限制:1000 ms | 内存限制:65535 KB
难度:1
- 描述
- 做了A+B Problem之后,Yougth感觉太简单了,于是他想让你求出两个数反转后相加的值。帮帮他吧
- 输入
- 有多组测试数据。每组包括两个数m和n,数据保证int范围,当m和n同时为0是表示输入结束。
- 输出
- 输出反转后相加的结果。
- 样例输入
1234 1234125 1170 0
- 样例输出
86421232
题目很简单,代码如下:
#include<stdio.h>#include<string.h>#include<math.h>#include<stdlib.h>int main(){int i,len1,len2,j,t;double k,s;char a[20],b[20];while(scanf("%s%s",a,b)&&(strcmp("0",a)!=0||strcmp("0",b)!=0)){len1=strlen(a);len2=strlen(b);k=0;t=0;s=0;for(i=0;i<len1;i++){t=a[i]-'0';k=k+t*pow(10.0,i*1.0);}for(i=0;i<len2;i++){t=b[i]-'0';s=s+t*pow(10.0,i*1.0);}printf("%.0lf\n",k+s);}return 0;}
0 0
- nyoj-844-A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ-844 A+B Problem(V)
- NYOJ-A+B Problem(V)
- NYOJ A+B Problem(V)
- nyoj 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- 【NYOJ】[844]A+B Problem(V)
- nyoj A+B Problem(V)
- nyoj A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- 【NYOJ-844】 A+B Problem(V)
- nyoj题目844:A+B Problem(V)
- 三角形类型判断
- 解决yum安装出现错误:Cannot retrieve metalink for repository: epel. Please verify its path and try again
- Linux之grep命令
- linux write函数是否原子操作
- Linux下使用有那(挂载)centos , ubuntu
- NYOJ A+B Problem(V)
- 为什么使用BeagleBone BeagleBone的优点
- Mac系统显示或隐藏文件夹的方法
- 5种将死的编程语言
- 如何测量MSP430的功耗?
- getServletContext().getRealPath("/")的测试
- getPath(), getAbsolutePath()和 getCanonicalPath() 的区别
- Ubuntu下v8 javascript虚拟机的编译与使用
- 基础算法系列(五)排序算法之冒泡排序