#include<iostream.h>
 struct complex
 {
   int x;
   int y;
 };
 struct fraction
 {
   int a;
   int b;
 }; 
 int main()
{
 int add(int x,int y);
 float add(float x,float y);
 complex add(complex m ,complex n );
 fraction add(fraction m ,fraction n );
 complex m1={1,2},m2={3,4},m3;//定义两个复数
 fraction n1={1,2},n2={3,4},n3;//定义两个有理分数
 cout<<"整数之和为："<<add(1,2)<<endl;
 cout<<"浮点数之和为："<<add(1.1f,2.2f)<<endl;
 m3=add(m1,m2);
 n3=add(n1,n2);
 cout<<"复数之和为："<<m3.x<<"+"<<m3.y<<"i"<<endl;  
 cout<<"分数之和为："<<n3.a<<"/"<<n3.b<<endl;  
 return(0);
}
 int add(int x,int y)
{
  return(x+y);
}
 float add(float x,float y)
{
  return(x+y);
}
 complex add(complex m ,complex n )
{
 complex c;
 c.x=m.x+n.x;
 c.y=m.y+n.y; 
 return(c);
}
 fraction add(fraction m, fraction n )
{
 fraction c;
 c.a=m.a*n.b+m.b*n.a;
 c.b=m.b*n.b; 
 return(c);
}