using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
int sum = 0;
int line = 1;
Console.WriteLine("1-100之间不能被7整除的数据为:");
for (int i = 1; i <= 100; i++)
{
if (i % 7 == 0)
{
continue;
}
else
{
Console.Write(i + "\t");
sum += i;
line++;
if (line % 4 == 0)
{
Console.WriteLine();
}
}
}
Console.WriteLine("数据总和:{0}", sum);
Console.ReadKey();
}
}
}
网友评论