结果不是 3 。根本无法编译。请注意「自动类型转换」中的第二例。在 Visual Studio 2017 中显示结果是:Cannot implicitly convert type `double' to `int'. An explicit conversion exists (are you missing a cast?) 不能隐式地将 double 型变量转换为 int 型。其中存在显式转换(你是不是漏掉了强制转换?)
2017-03-21
最赞回答 / 一念征途
<...code...>你好,第一行:<...code...>后面的= 不应该加, 需要删掉;第二:a的长度,不是8,也不是2,而是16,如果按你之前写的话,会数组越界,所以需要改成16的一半,也就是a的长度除以2;第三,数组的长度 用a.Length 就可以了第四:最后一行:<...code...>a[i,1]需要改成a[t, 1], i因为你是在for循环中定义的,所以在for循环以外,i就不能用了。祝你学习顺利!
2017-03-18
已采纳回答 / 雨忆_雪沁渊
using System;using System.Collections.Generic;using System.Text;namespace Test{ class Program { static void Main(string[] args) { for (int i=1;i<=7;i++) { for (int a = 1; a <= 7; a++) ...
2017-03-18