求大虾帮我看看我的c#窗体质数代码怎么实现输出结果每满5个就自动换行
我输出结果总是排成一行namespace_100zhishu{publicpartialclassForm1:Form{publicForm1(){InitializeC...
我输出结果总是排成一行namespace _100zhishu{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void yunxing_Click(object sender, EventArgs e) {
int j; int i;
for ( i = 2; i <= 100; i++)
{
for(j=2;j<=i/2;j++)
{
if(i%j==0)
break;
}
if (j > i / 2) { labshow.Text += i + " ";}
}
}
} } 展开
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void yunxing_Click(object sender, EventArgs e) {
int j; int i;
for ( i = 2; i <= 100; i++)
{
for(j=2;j<=i/2;j++)
{
if(i%j==0)
break;
}
if (j > i / 2) { labshow.Text += i + " ";}
}
}
} } 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询