摘要:
题目:在order结构中添加另一个函数,该结构返回一个格式化的字符串,以合适的值替换用尖括号括起来的斜体条目。Order Information:<unit count> <item name> items at $<unit cost> each,total cost $<total cost>代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;names 阅读全文
摘要:
题目:修改下面的结构,使之包含一个返回订单总价格的函数。struct order { public string itemName; public int unitCount; public double unitCost;}代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;namespace Test{ class Program... 阅读全文
摘要:
题目:创建一个委托,在请求用户输入时,使用它模拟Console.ReadLine()函数。代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;namespace Test{ class Program { delegate string processdelegate(); static void Main(string[] args) { ... 阅读全文
摘要:
题目:编写一个应用程序,该程序使用两个命令行参数,分别把值放在一个字符串和一个整数变量中,然后显示这些值。代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;namespace Test{ class Program { static void Main(string[] args) { int integer; stri... 阅读全文