注册 登录
编程论坛 C# 论坛

哪位大神帮忙看看这个窗体程序哪里错了

二琪 发布于 2016-12-20 23:00, 2609 次点击
using System;using System.Collections.Generic;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication4{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void textBox2_TextChanged(object sender, EventArgs e)        {        }        private void button1_Click(object sender, EventArgs e)        {            int a, b, c,j,i=0;            a = int.Parse(textBox1.Text);            b = int.Parse(textBox2.Text);            for (c = a; c <= b;c++);            {                if (c % 3 == 0 && c % 5 == 0 && c % 100 != 0);                textBox3 .Text =textBox3 .Text +c.ToString()+'\t';                    i++;                    if (i % 5 == 0) ;                    {                        textBox3 .Text +="\r\n";                    }                }            }        }    }
5 回复
#2
某一天2017-01-22 11:58
这代码太乱了!
#3
某一天2017-01-22 12:03
两个if后面的分号应该没有的吧?
if (c % 3 == 0 && c % 5 == 0 && c % 100 != 0);   
 if (i % 5 == 0) ;
#4
GreenLight2017-01-25 09:37
打断点用F10一步一步调试,很容易找到问题的
#5
lhb622323972017-02-06 16:52
错误太多了
1、for循环后面加分号?
2、if条件后面加分号?
3、代码的逻辑好像有些问题,因为太乱了,没有看清楚。
#6
hzzasdf2017-02-09 04:43
if (i % 5 == 0) ; 这个分号很可疑
1