c#程序设计教程(李春葆第三版)第五章课后程序题答案 .pdfVIP

  • 7
  • 0
  • 约4.5千字
  • 约 5页
  • 2023-10-13 发布于广西
  • 举报

c#程序设计教程(李春葆第三版)第五章课后程序题答案 .pdf

c#程序设计教程(李春葆第三版)第五章课后程序题答案 exci5-1 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace exci5_1 { class Program { static void Main(string[] args) { Person p1 = new Person(2, 50); Animal a1 = new Animal(4,120); p1.show(); a1.show(); } } public class Person //定义⼈类 { public int legs; //腿的只数 protected float weight; //重量 public Person() //默认构造函数 { } public Person(int legs1, float weight1)//⾃定义⽅法F { legs = legs1; weight = weight1; } public void show() { Console.WriteLine(“

文档评论(0)

1亿VIP精品文档

相关文档