新手開車?。?!
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? //聲明整型數(shù)組,保存一組整數(shù)
? ? ? ? ? ? int[] num = new int[] { 3,34,43,2,11,19,30,55,20};
? ? ? ? ? ? bool on_off =false ;
? ? ? ? ? ? foreach (int x in num)
? ? ? ? ? ? if(x%7==0)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? on_off = true;
? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }
? ? ? ? ? ? if(on_off)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.Write("有7的整倍數(shù)");
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.Write("沒有7的整倍數(shù)");
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2019-03-13