第四章,简答题4-5,2017-4-6
生活随笔
收集整理的這篇文章主要介紹了
第四章,简答题4-5,2017-4-6
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
巫師屬性類-------
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace 第四章_簡(jiǎn)答題5.entity 8 { 9 public class Wus 10 { 11 public int SM { get; set; }//生命 12 public int Do { get; set; }//戰(zhàn)斗值 13 public int ji { get; set; }//級(jí)別 14 /// <summary> 15 /// 默認(rèn)巫師生命值 16 /// </summary> 17 public Wus() 18 { 19 SM = 10000; 20 } 21 /// <summary> 22 /// 巫師屬性 23 /// </summary> 24 public Wus(int Sm,int DO,int Ji) 25 { 26 this.SM = Sm; 27 this.Do = DO; 28 this.ji = Ji; 29 } 30 /// <summary> 31 /// 顯示巫師屬性 32 /// </summary> 33 public void SayHi() 34 { 35 Console.WriteLine("巫師生命值是:"+this.SM+"戰(zhàn)斗值是:"+this.Do+"級(jí)別:"+this.ji); 36 } 37 38 } 39 }?
巫師Main----
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using 第四章_簡(jiǎn)答題5.entity; 7 8 namespace 第四章_簡(jiǎn)答題5 9 { 10 class Program 11 { 12 static void Main(string[] args) 13 { 14 Wus w=new Wus(200000,5000,30); 15 w.SayHi(); 16 } 17 } 18 }?
?
螞蟻類--------
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace 第四章_簡(jiǎn)答題4.entity 8 { 9 public class ming 10 { 11 public string name { get; set; } 12 13 public ming(string Name) 14 { 15 this.name = Name; 16 } 17 public void SayHia() 18 { 19 Console.WriteLine("我是:"+this.name); 20 } 21 } 22 } 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace 第四章_簡(jiǎn)答題4.entity 8 { 9 public class tian 10 { 11 public string name { get; set; } 12 public int count { get; set; } 13 public tian(string Name,int Count) 14 { 15 this.name = Name; 16 this.count = Count; 17 18 } 19 20 public void SayHi() 21 { 22 Console.WriteLine("我找到一塊甜品:"+this.name); 23 Console.WriteLine("我呼叫到"+this.count+"小伙伴"); 24 25 } 26 } 27 }?
螞蟻main--------
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using 第四章_簡(jiǎn)答題4.entity; 7 8 namespace 第四章_簡(jiǎn)答題4 9 { 10 class Program 11 { 12 static void Main(string[] args) 13 { 14 ming m = new ming("小不點(diǎn)"); 15 m.SayHia(); 16 tian t = new tian("hhh", 2); 17 t.SayHi(); 18 Console.WriteLine("現(xiàn)在,大家搬家遠(yuǎn)甜品!"); 19 Console.WriteLine("我們完成尋找甜品的任務(wù)!"); 20 } 21 } 22 }?
轉(zhuǎn)載于:https://www.cnblogs.com/yjjh/p/6676043.html
總結(jié)
以上是生活随笔為你收集整理的第四章,简答题4-5,2017-4-6的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 贵州撸串配什么小菜?
- 下一篇: oi程序提交注意:bool