資源簡介
啤酒兩塊錢一瓶,4個瓶蓋換一瓶,2個酒瓶換一瓶,請問10元可以喝多少瓶酒
代碼片段和文件信息
using?System;
namespace?HelloWorldApplication
{
????class?HelloWorld
????{
????????static?void?Main(string[]?args)
????????{
????????????/*?我的第一個?C#?程序*/
????????????Console.WriteLine(“Hello?World!“);
????????????Console.ReadKey();
Exchange?ex=new?Exchange();
ex.Pay(108);
Console.WriteLine(ex.self.Jiu+“?jiu\r\n“+ex.self.Gai+“?gai\r\n“+ex.self.Ping+“?ping“);
????????}
????}
public?class?Exchange{
public?const?int?baseGai=4;//4個酒蓋換一瓶酒
public?const?int?basePing=2;//2個酒瓶換一瓶酒
public?const?int?basePrice=2;//2元一瓶酒
public?MySelf?self{get;set;}
public?void?Pay(int?price){
if(self==null)self=new?MySelf(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1365??2016-09-05?23:10??買酒換酒.cs
評論
共有 條評論