請幫幫我看看吧
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? //聲明整型數組,保存一組整數
? ? ? ? ? ? int[] num = new int[] { 3,34,43,2,11,19,30,55,20};
? ? ? ? ? ??
? ? ? ? ?bool has7=false;
? ? ? ? ?for(int=0;i<num.Length;
? ? ? ? ?i++)
? ? ? ? ?if (num[i]%7==0)
? ? ? ? ?has7=true;
? ? ? ? ?break;
? ? ? ? ?if?
? ? ? ? ?(has7)
? ? ? ? ?Console.WriteLine("");
? ? ? ? ?else
? ? ? ? ?Console.WriteLine("");
? ? ? ? ?//請完善代碼,判斷數組中有沒有7的整倍數
? ? ? ? ? ??
? ? ? ? }
? ? }
}
2021-03-06
自我debug已經完成:
15行for循環中int=0是錯誤的,應為int i=0。
接下來會因為我使用了break而報錯,刪除break;即可解決問題。