/*
*Copyright(c)2014,烟台大学计算机学院
*All rights reserved.
*文件名称:test.cpp
*作者:梁璨
*完成日期:2014年 12月 4日
*版本号:v1.0
*
*问题描述:求出两数和与差;
*程序输入:任意两个数;
*程序输出:两数的和与差;
*/
#include <iostream>
using namespace std;
void ast(int x,int y,int *cp,int *dp)
{
*cp=x+y;
*dp=x-y;
}
int main()
{
int a,b,c,d;
cin>>a>>b;
ast(a,b,&c,&d);
cout<<c<<" "<<d<<endl;
return 0;
}
运行结果: