可否写入整个程序啊,我需要用windows message box 显示以上题目的结果啊,可我不会啊,我写了第一个题目,但是windows message box显示不出来
.
为了这两个题目我都想了两天,都没想出来,我检查的时候没错啊 我用的是visual studio2008 ,应该差别不大把
程序如下
using System;
using System.Windows.Forms;
namespace Assignment6Problem1
{
class Program
{
static void Main(string[] args)
{
bool result = true;
Random numb = new Random();
int y = numb.Next(0, 100); y++;
int evenCount = 0, maximum = 1000, minimum = 0, total = 0;
while (result)
{
if (y % 2 == 0)
evenCount++;
if (y > maximum)
maximum = y;
if (y < minimum)
minimum = y;
total = total + y;
total = total / 100;
Console.Write("{0}", "{1}", "{2}", "{3}", "{4}", y, evenCount, maximum, minimum, total);
if (MessageBox.Show("afd?", "fafd", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
result = false;
}
else
{
y = numb.Next(100);
}
}
}
}
}