zoukankan      html  css  js  c++  java
  • 2017.4.6课后作业(第四章.简答题4)

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace lesson4.entity
     8 {
     9     /// <summary>
    10     /// 甜品类
    11     /// </summary>
    12     class TP
    13     {
    14         public TP(string name)
    15         {
    16             this.Name = name;
    17         }
    18          
    19         /// <summary>
    20         /// 甜品名
    21         /// </summary>
    22         public string Name { get; set; }
    23     }
    24 }
    View Code
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace lesson4.entity
     8 {
     9     /// <summary>
    10     /// 蚂蚁类
    11     /// </summary>
    12     class MY
    13     {
    14         public MY(string name)
    15         {
    16             this.Name = name;
    17         }
    18         /// <summary>
    19         /// 蚂蚁名字
    20         /// </summary>
    21          public string Name{get;set;}
    22 
    23 
    24         /// <summary>
    25         /// 问好
    26         /// </summary>
    27          public void SayHi()
    28          {
    29              Console.WriteLine("大家好!我是一只小蚂蚁,名叫"+Name);
    30          }
    31 
    32         /// <summary>
    33         /// 找甜品
    34         /// </summary>
    35          public void Find(TP tp)
    36          {
    37              Console.WriteLine("我找到一块甜品:{0}",tp.Name);
    38          }
    39 
    40         /// <summary>
    41         /// 招呼伙伴
    42         /// </summary>
    43          public void Partner(int count)
    44          {
    45              Console.WriteLine("我招呼到{0}个同伴",count);
    46          }
    47 
    48         /// <summary>
    49         /// 工作
    50         /// </summary>
    51          public void Work()
    52          {
    53              Console.WriteLine("现在,大家搬运甜品");
    54              Console.WriteLine("我们完成寻找甜品的任务!");
    55          }
    56     }
    57 }
    View Code
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 using lesson4.entity;
     7 
     8 namespace lesson4
     9 {
    10     class Program
    11     {
    12         static void Main(string[] args)
    13         {
    14             MY my = new MY("小不点");
    15             my.SayHi();
    16             TP tp = new TP("提拉米苏");
    17             my.Find(tp);
    18             my.Partner(2);
    19             my.Work();
    20             Console.Read();
    21         }
    22     }
    23 }
    View Code
  • 相关阅读:
    hdu1561 The more, The Better 树形DP+分组背包
    hdu1520 Anniversary party 简单树形DP
    hdu1054 Strategic Game 树形DP
    hdu1011 Starship Troopers 树形DP
    hdu4681 String DP(2013多校第8场)
    zoj3469 Food Delivery 区间DP
    LightOJ 1422 -Halloween Costumes 区间DP
    hdu4283 You Are the One 区间DP
    poj1651 Multiplication Puzzle 区间DP
    codeforce 149D Coloring Brackets 区间DP
  • 原文地址:https://www.cnblogs.com/weiai520/p/6676154.html
Copyright © 2011-2022 走看看