两个小数相加
2016-04-25 14:04
218 查看
/*
*copvriqht(c)2016,烟台大学计算机学院
*All rights reserved.
*文件名称:test.cpp
*作者:陈传祯
*完成日期:2016年4月25日
*版本号:v1.0
*
*问题描述
*输入描述
*程序输出
*/
#include<iostream>
using namespace std;
struct xiaoshu
{
int head;
char point;
int tail;
};
void add(struct xiaoshu a,struct xiaoshu b)
{
cout<<a.head+b.head<<a.point<<a.tail+b.tail<<endl;
}
int main()
{
xiaoshu a,b;
void add(xiaoshu,xiaoshu);
cin>>a.head>>a.point>>a.tail;
cin>>b.head>>b.point>>b.tail;
add(a,b);
return 0;
}
/*
*copvriqht(c)2016,烟台大学计算机学院
*All rights reserved.
*文件名称:test.cpp
*作者:陈传祯
*完成日期:2016年4月25日
*版本号:v1.0
*
*问题描述
*输入描述
*程序输出
*/
#include<iostream>
using namespace std;
struct xiaoshu
{
int head;
char point;
int tail;
};
void add(struct xiaoshu a,struct xiaoshu b)
{
cout<<a.head+b.head<<a.point<<a.tail+b.tail<<endl;
}
int main()
{
xiaoshu a,b;
void add(xiaoshu,xiaoshu);
cin>>a.head>>a.point>>a.tail;
cin>>b.head>>b.point>>b.tail;
add(a,b);
return 0;
}
相关文章推荐
- Linux性能监控工具dstat
- 对“视觉机器学习20讲配套仿真代码”的研究心得---贝叶斯学习
- Linux下git使用详解1
- 二、 sql*plus常用命令
- 使用hexo搭建属于自己的博客
- android监听通讯录内容变化
- 如何从命令行实时监控Nginx Web服务器
- 51nod 1076 2条不相交的路径(tarjan)
- Found 2 versions of android-support-v4.jar in the dependency list,but not all the versions are ident
- bean validation 分组验证及分组顺序---学习笔记
- 剑指offer(15):调整数组顺序使奇数位于偶数前面
- Hive的三种调用方式
- Java的多态在方法重载和重写时的情况
- 从前端开始
- sublime text 3103 怎么设置中文
- HTML学习笔记
- 记录遇到的IE8兼容性问题汇总
- 转自小木虫:三年来评审18篇SCI文章的一点感受
- qt的addWidget、setColumnStretch 等的使用方法
- 剑指offer 数组中出现次数超过一半的数字