代碼有問(wèn)題
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? //聲明整型數(shù)組,保存一組整數(shù)
? ? ? ? ? ? int[] num = new int[] { 3,34,43,2,11,19,30,55,20};
? ? ? ? ? ? //請(qǐng)完善代碼,判斷數(shù)組中有沒(méi)有7的整倍數(shù)
? ? ? ? ? ? bool has7=false;
? ? ? ? ? ? foreach(int x in num)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(x%7==0)
? ? ? ? ? ? ? ? {has7=true;
? ? ? ? ? ? ? ? break;}
? ? ? ? ? ? }
? ? ? ? ? ? if(has7)
? ? ? ? ? ? Console.writeLine("有7的倍數(shù)");
? ? ? ? ? ? else
? ? ? ? ? ? Console.writeLine("沒(méi)有7的倍數(shù)");
? ? ? ? }
? ? }
}
2018-05-20
我的哥,最后2行的輸出語(yǔ)句writeLine,w大寫(xiě)