深入.NET平台和C#理解--第二章上级(1,2)--积分更新和计算机ID
来源:互联网 发布:js中的tostring方法 编辑:程序博客网 时间:2024/04/29 04:57
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Day02_05上机题{ class Program { static void Main(string[] args) { //历史积分数组 int[] points = new int[5]; //新积分数组 int[] newPoints = new int[5]; Console.WriteLine("请输入5位会员的积分"); for (int i = 0; i < points.Length; i++) { Console.WriteLine("第"+(i+1)+"位会员积分"); points[i] = Convert.ToInt32(Console.ReadLine()); } for (int i = 0; i < points.Length; i++) { newPoints[i] = points[i]; newPoints[i] = newPoints[i] + 500; } Console.WriteLine("\n序号\t历史积分\t新年积分"); for (int i = 0; i < points.Length; i++) { Console.WriteLine((i+1) + "\t" + points[i] + "\t" + newPoints[i]); } Console.ReadLine(); } }}
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Day02_06上机题2计算机ID{ class Computer { string[] computers = new string[3]; string[] newcomputers = new string[3]; string[] arr = new string[3]; public void Show(){ computers[0] = "hpCQ-217TX"; computers[1] = "Mc24OCH/A"; computers[2] = "SYNW18H/W"; Console.WriteLine("***************设置计算机ID前***************"); Console.WriteLine("计算机型号\t计算机ID\t购买时间"); for (int i = 0; i < computers.Length; i++) { Console.WriteLine(computers[i]+"\t"+""+"\t\t"+"2013-10-5"); } Console.WriteLine("\n***************设置计算机ID后***************"); Console.WriteLine("计算机型号\t计算机ID\t购买时间"); //产生随机数 Random r = new Random(); for (int i = 0; i <arr.Length; i++) { arr[i] = r.Next(1000, 10000).ToString(); } for (int i = 0; i < computers.Length; i++) { newcomputers[i] = computers[i] + "-" + arr[i]; Console.WriteLine(computers[i] + "\t" + newcomputers[i] + "\t" + "2013-10-5"); } Console.ReadLine(); } }}
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Day02_06上机题2计算机ID{ class Program { static void Main(string[] args) { Computer computer = new Computer(); computer.Show(); } }}
0 0
- 深入.NET平台和C#理解--第二章上级(1,2)--积分更新和计算机ID
- 深入.NET和C#平台 第二章
- 深入.NET平台和C#编程 第二章 学习笔记
- 深入.NET平台和C#编程--第二章经理评分
- 深入.NET平台和C#编程 第二章上机练习1
- 深入.NET平台和C#编程 第一章第二章 课后简答
- 深入.NET平台和C#编程 第二章 上机3 经理评分
- 深入。NET平台和C#编程 第二章课后练习 购物 + 加分
- 深入.NET平台和C#编程第二张上机练习2
- 深入.NET第六章上级和简答题
- 深入.NET平台和c#理解------第三章上机题员工打卡
- ACCP7.0S2深入.NET和C#编程第二章上机1,2
- (1-2)章深入.NET平台和C#编程 复习的时候 整理的笔记
- 深入.NET和C#第二章上机3
- 深入.NET平台和C#编程---总结
- 深入.NET平台和C#编程 第三章 学习笔记
- 深入.NET平台和C#编程 第四章 学习笔记
- 深入.NET平台和C#编程 第五章 学习笔记
- mysql 表分区
- C# 中双重检测单例模式
- shape使用
- maven: 打包可运行的jar包(java application)及依赖项处理
- 【Android】数据库SQLite
- 深入.NET平台和C#理解--第二章上级(1,2)--积分更新和计算机ID
- c语言链队列的构建
- 常用地址
- js延时加载
- 利用map()函数,把用户输入的英文名字,变为首字母大写,其他小写的规范名字&&键盘输入的整数相加
- 关于按钮layout_gravity设置为right不管用的问题
- GC算法和种类【重要】
- 每天一个 Linux 命令(30): chown命令
- 001 - 全、半角 英文切换