注册 登录
编程论坛 新人交流区

初来报到

Elton_Tsui 发布于 2007-11-15 09:15, 703 次点击
初来报到,请大家多指教!!
9 回复
#2
夜色长空2007-11-15 09:46
一样一样
#3
klkl998892007-11-15 10:59

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication13
{
//修改下面的结构,使之包含一个返回订单总价格的的函数.
//struct order
//{
// public string itemName;
// public int unitCount;
// public double unitCost;
//}
struct order
{
public string itemName;
public int unitCount;
public double unitCost;
public double total()
{
string str = string.Empty;
str = "order information:" + unitCount+" "+itemName+"item as$"+unitCost+"each,total cost$"+unitCount*unitCost;
Console.WriteLine(str);
// return unitCount * unitCost;
}

}
class Program
{
static void Main(string[] args)
{
order myOrder;
myOrder.itemName = "Mr.Children HOME";
myOrder.unitCount = 100;
myOrder.unitCost = 12.5;
//调用结构函数
myOrder.total();
// Console.WriteLine(myOrder.total());
//Console.WriteLine(myOrder.);
Console.ReadKey();
}
}
}

#4
panicemaster2007-11-15 11:00
都是这样的a
#5
cn005404012007-11-15 11:05
#6
ka1872007-11-17 19:45
我也是
#7
Sunjeluo2007-11-17 20:32
认识一下,我也是新来的.
#8
zhou1292007-11-18 09:47
纯属路过,帮新人顶一下
#9
platformer2007-11-18 10:00
hehe
#10
am12106562082007-11-19 14:52

一样啊
互相学习

1