acm A+B Problem(V)
来源:互联网 发布:2013网络作家富豪榜单 编辑:程序博客网 时间:2024/06/04 17:48
- 输入
- 有多组测试数据。每组包括两个数m和n,数据保证int范围,当m和n同时为0是表示输入结束。
- 输出
- 输出反转后相加的结果。
- 样例输入
1234 1234125 1170 0
- 样例输出
86421232
思路:
将数反序输出,在求和。
代码:
#include <stdio.h>int fun(int x){int d,t=0;while (x){d=x%10;t=t*10+d;x=x/10;}return t;}main(){int a,b,i,t=0,t1=0,s,d;for (i=0;;i++){t=0,t1=0;scanf("%d%d",&a,&b);if (a+b==0)break; a=fun(a); b=fun(b);printf("%d\n",a+b);}}
0 0
- acm A+B Problem(V)
- 南阳ACM 844 A+B Problem(V)
- A+B Problem(v) 南阳理工ACM 题目844
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- A+B Problem(V)
- nyoj-844-A+B Problem(V)
- 844-A+B Problem(V)
- NYIST 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- NYOJ 844 A+B Problem(V)
- BZOJ 4568: [Scoi2016]幸运数字
- Best Text Editer
- CMake 指定安装目录
- 一篇博文带你认识java的三大特性之一的多态性
- 12081
- acm A+B Problem(V)
- Spring第三阶段
- 关键路径
- 12082
- Android TV 中遇到的问题和解决方法 ,16/12/8 01
- logback与Spring、SpringMVC结合使用教程
- NodeJS搭建博客系统(四)使用模版引擎(node+express+ejs做的一个demo)
- EasyPR--开发详解(9)文字定位
- js第一课