复数
来源:互联网 发布:mac怎么玩免费的游戏 编辑:程序博客网 时间:2024/04/29 02:26
// // Copyright (c) 2014软件技术1班 // All rights reserved. // 作 者:A08梁运基 // 完成日期:2014年 12 月 16 日 // 版 本 号:v1.0 // // 问题描述:创建一个程序来求复数的性质。
<pre name="code" class="csharp">using System;using System.Collections.Generic;using System.Linq;using System.Text;
namespace 复数{ class Program { static void Main(string[] args) { plural rectl = new plural(); //int a, b, c, d; Console.WriteLine("请输入一个整数给复数a"); rectl.a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("请再输入一个整数给复数a"); rectl.b = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("请输入一个整数给复数b"); rectl.c = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("请再输入一个整数给复数b"); rectl.d = Convert.ToInt32(Console.ReadLine()); NewMethod(rectl); Console.Read(); } private static void NewMethod(plural rectl) { Console.WriteLine("复数的和为{0}+{1}i", rectl.And()); Console.WriteLine("复数的差{0}-{1}", rectl.Subtract()); Console.WriteLine("两复数相加产生新的复数为{0}+{1}", rectl.Andition()); Console.WriteLine("两复数相减产生新的复数为{0}+{1}", rectl.Subtraction()); } } class plural { public int a; public int b; public int c; public int d; public int And() { return a+b; } public int Subtract() { return a-b; } public int Andition() { return a+c-b+d; } public int Subtraction() { return a-c-b-d; } }}
// 输入描述:一个实数 // 程序输出:一个结果 //
0 0
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- 复数
- Leetcode Intersection of Two Linked Lists
- 近期总结
- {12月13日}“大数据讲座听后感”
- a5.java
- HDU2051(数制转换)
- 复数
- Leetcode Longest Substring with At Most Two Distinct Characters
- Divide Two Integers
- 时间控件
- WIN7下资源管理器默认打开我的电脑
- ubuntu下的PDF阅读器
- @SuppressWarnings注解
- UVA - 12235(压缩dp + 滚动数组)
- UVa 1583-Digit Generator-AC