感觉是对的,但为什么是错的呢
int[] num = new int[] { 3, 34, 43, 2, 11, 19, 30, 55, 20 };
foreach (int x in num)
if (num[x] % 7 == 0)
{
Console.WriteLine("有7的整数倍");
}
else
Console.WriteLine("没有7的整数倍");
int[] num = new int[] { 3, 34, 43, 2, 11, 19, 30, 55, 20 };
foreach (int x in num)
if (num[x] % 7 == 0)
{
Console.WriteLine("有7的整数倍");
}
else
Console.WriteLine("没有7的整数倍");
2016-01-16
举报