using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication7//2014级软件技术一班A21
{
class Program
{
static void Main(string[] args)
{ Complex count=new Complex();
count.a = 1;
count.b = 2;
count.c = 3;
count.d = 4;
Console.WriteLine("两个复数之和:{0}+{1}",count.Add(),count.Add1());
Console.WriteLine("两个复数之和:{0}+{1}",count.Sub(),count.sub1());
Console.ReadKey();
}
}
class Complex
{
public int a;
public int b;
public int c;
public int d;
public int Add()
{
return a + c;
}
public string Add1()
{
return (b+d)+"i";
}
public int Sub()
{
return a - c;
}
public string sub1()
{
return (b - d) + "i";
}
}
}
复数
最新推荐文章于 2023-05-06 19:45:56 发布