113.根据要求合并两个整数
2015-06-29 21:40
387 查看
函数fun的功能是:将a、b中的两个两位数整数合并形成一个新的整数放在c中。合并的方式是:将a的十位和个位依次放在变量c的百位和个位上,b中的十位和个位数依次放在变量的c放十位和千位上。
</pre><pre name="code" class="cpp">#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> void fun(int a,int b,long *c) { *c = a / 10 * 100 + a % 10 + b / 10 * 10 + b % 10 * 1000; } int main() { int a, b; long c; printf("Input a,b:"); scanf("%d%d", &a, &b); fun(a, b, &c); printf("The result is:%ld", c); system("pause"); return 0; }
相关文章推荐
- iOS开发入门实例
- Java基础总结之反射
- 日志分析系统所用知识
- 二叉树题目集合
- c语言结构体指针初始化
- vi编辑器的常用命令
- AJAX异步检查,检查用户名是否存在
- 互联网行业的奇葩问答,瞬间秒碎你的节操!
- [leetcode][math] Basic Calculator II
- Android AsyncTaskLoader需要注意的问题
- nc默认枚举,获取前台传过来的数据块
- 谈谈对AOP的认识三——优化AOP,进一步解耦
- Xamarin.Android开发实践(一)
- (译)Asynchronous programming and Threading in C# (.NET 4.5)
- [LeetCode] Add Two Numbers
- 数组赋值于双指针
- 一款实现浏览实事的资讯平台app
- Kmeans聚类与dbscan聚类对比
- Spring-mvc传参数
- HDOJ 2021 发工资咯:)(水题)