bool a = false;
foreach (int i in num)
{
if (num[i] % 7 == 0)
a = true;
break;
}
if (a)
Console.Write("有7的整倍数");
else
Console.Write("没有7的整倍数");
foreach (int i in num)
{
if (num[i] % 7 == 0)
a = true;
break;
}
if (a)
Console.Write("有7的整倍数");
else
Console.Write("没有7的整倍数");
string[] names = new string[]{ "吴松", "钱东宇", "伏晨", "陈陆", "周蕾", "林日鹏", "何昆", "关欣"};
int[] num=new int[]{89,90,98,56,60,91,93,85};
int aa = 0;
int bb = 0;
for(int a;a<num.Length;a++){
if(aa<num[a]){
aa=num[a];
bb=a;
}
}
Console.WriteLine("分数最高的是{0},分数是{1}",name[bb],aa);
求大师指导
int[] num=new int[]{89,90,98,56,60,91,93,85};
int aa = 0;
int bb = 0;
for(int a;a<num.Length;a++){
if(aa<num[a]){
aa=num[a];
bb=a;
}
}
Console.WriteLine("分数最高的是{0},分数是{1}",name[bb],aa);
求大师指导