#include <iostream>
using namespace std;
void ast(int x,int y,int *cp,int *dp)
{
*cp=x+y;
*dp=x-y;
return;
}
int main( )
{
int a,b,c,d;
cin>>a>>b;
ast(a,b,&c,&d);
cout<<c<<" "<<d<<endl;
return 0;
}
运行结果:
<img src="https://img-blog.csdn.net/20141208152451620?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2QxMjAy/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />