private void button1_Click(object sender, EventArgs e)
{
for (int n = 100; n < 1000; n++)
{
int a = n / 100;
int b = n / 10 % 10;
int c = n % 10;
int x=a*a*a+b*b*b+c*c*c;
if (n==x)
textBox1.Text += Convert.ToString(n) + "\r\t";
}
}
C# 水仙花数
最新推荐文章于 2024-03-16 10:39:29 发布