using System;
namespace 实验4
{
class shiyan4
{
static void Main(string [] args)
{
while (true)
{
Console.Write("请输入5个整数(空格分隔):");
string s = Console.ReadLine();
if (s.Length == 0)
return;
string[] a = s.Split(' ');
if (a.Length != 5)
{
Console.WriteLine("输入的不是5个数,请再次输入。");
continue;
}
bool flag = true;
int[] b = new int[5];
for (int i = 0; i < b.Length; i++)
{
if (int.TryParse(a[i], out b[i]) == false)
{
Console.WriteLine("输入的字符不是整数,请再次输入。",
a[i]);
flag= false;
评论0
最新资源