返回列表 发帖

第4章的习题希望有人回答

protected void Page_Load(object sender, EventArgs e)
    {
        int [ ,] salary = new int[12,31];
        int n=0;


        for (int i = 0; i < 12; i++)
        {
            for (int j = 0; j < 31; j++)
            {

                salary[i, j] = n++;
                Response.Write(salary [i,j]+"<br>");
                Hashtable ht = new Hashtable();
                ht.Add("i,j", salary[i, j]);
                foreach (DictionaryEntry de in ht)
                {
                    Response.Write(de.Value );
                    Response.Write(de.Key );
               
                }
            
            }


            
        
        }


    }
1。我不知道用forech 怎么循环。
2、我想输出response.write("salary[{0},{ 1}]={2}",i,j,salary[i, j]);这个样子的老是说write没有4个参数。应该怎么写。
3、哈希表应该怎么存储ht.Add("i,j", salary[i, j]);
就像ht.add("0,0",0)这样的存储。
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友

在同样问题里面,前面已经回答了。谢谢!

http://www.wanjuanchina.net/thread-370-1-1.html

TOP

返回列表