?namespace ConsoleApplication1
?{
class Program
{
static void Main(string[] args)
?{
?Console.WriteLine("1~100中所有不能被7整除的數(shù)有:");
int sum=0;
int num = 0;
?for(int i=1;i<=100;i++)
{
?if(i % 7!=0)
?{
?sum += i;
?num++;
Console.Write(i + "\t");
?}
?if (num == 4)
{
?Console.WriteLine();
num = 0;
}
}
?Console.WriteLine("");
?Console.WriteLine ("數(shù)據(jù)之和為{0}",sum);
?Console.ReadKey();
}
}
}