.net 第二章上机练习
来源:互联网 发布:数据瀑布图画法 编辑:程序博客网 时间:2024/04/30 05:42
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { int[] old =new int[5]; int[] New=new int[5]; Console.WriteLine("请输入五位会员的积分"); for (int i = 0; i < old.Length;i++ ) { Console.WriteLine("第"+(i+1)+"位会员的积分"); old[i] = Convert.ToInt32(Console.ReadLine()); } for (int i = 0; i < old.Length;i++ ) { New[i] = old[i]; New[i] = New[i]+500; } Console.WriteLine("序号\t\t历史积分\t\t新年积分"); for (int i = 0; i < old.Length;i++ ) { Console.WriteLine((i + 1) + "\t\t" + old[i] + "\t\t\t" + New[i]); } Console.WriteLine("按任意键继续。。。"); Console.ReadLine(); } }}
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 上机2{ public class Computer { public string xinghao; public int comID; public string date; }}using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 上机2{ class Program { static void Main(string[] args) { Computer computer = new Computer(); Computer[] com = new Computer[3]; com[0] = new Computer(); com[0].xinghao = "hpCQ-217TX"; com[0].date = "2013-10-5"; com[1] = new Computer(); com[1].xinghao = "Mc240CH/A"; com[1].date = "2013-10-5"; com[2] = new Computer(); com[2].xinghao = "SYNW18H/W"; com[2].date = "2013-10-5"; Console.WriteLine("===========设置计算机id前==========="); Console.WriteLine("计算机型号\t计算机id\t购买时间"); for (int i = 0; i < com.Length; i++) { Console.WriteLine(com[i].xinghao + "\t\t\t" + com[i].date); } Random ran = new Random(); com[0].comID = ran.Next(1000, 9999); com[1].comID = ran.Next(1000, 9999); com[2].comID = ran.Next(1000, 9999); Console.WriteLine("===========设置计算机id后==========="); Console.WriteLine("计算机型号\t计算机id\t购买时间"); for (int i = 0; i < com.Length; i++) { Console.WriteLine(com[i].xinghao + "\t" + com[i].xinghao + "-" + com[i].comID + "\t" + com[i].date); } Console.ReadLine(); } }}
0 0
- .net 第二章上机练习
- .NET第二章上机练习
- .net 第二章上机练习1
- 深入.NET 第二章 上机练习1
- 深入.NET 第二章 上机练习2
- 第二章 上机练习
- 第二章上机练习
- 第二章上机练习
- 第二章上机练习
- 第二章上机练习3
- .Net 第二章练习
- HTML第二章上机练习1
- HTML第二章上机练习2
- HTML第二章上机练习3
- 深入.NET平台和C#编程 第二章上机练习1
- S2 深入.NET 第二章 上机题
- 深入.NET 第二章 练习
- 《算法竞赛入门经典》上机练习——第二章
- linux的./configure --prefix的作用
- 自定义导航按钮UIBarButtonItem
- 初识Netty
- sqlserver2008R2还原数据库
- Linux内存管理之mmap详解
- .net 第二章上机练习
- codevs 2664_上厕所
- 如何定位Release程序崩溃原因
- SVG图形初探
- bzoj2160(manacher)
- 使用类的反射机制执行类中的方法
- dsst跟踪算法源码分析
- 一些插件
- html5基础学习(依据小码哥视频学习)