前端之家收集整理的这篇文章主要介绍了
[VB.NET]一个简单的编程问题,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
一个简单的编程问题 1·求满足不等式1+2*2+3*3+……+n*n <=1000的最大n的值用(vb.net做) 2编程:将从
键盘上输入的若干个正数求和,遇到负数则终止程序,并且输入的数不超过10个 两个简单的问题,高手门尽快
回复我啊 __________________________________________________________________________ 1,应该是这样吧 Dim i,j As Integer Do i += 1 j += i * i Loop While j <= 10000 Message
Box.Show(i.ToString) __________________________________________________________________________ i多加了一次,要减1 ,答案i=30 __________________________________________________________________________ 哈哈,眼睛看花了,楼主是 <=一千啊 __________________________________________________________________________ 第一个式子是有名的自然数幂求和中的次简单的式子(最简单的是 1加到100:101*50),这可是很高深的问题哦^__^ __________________________________________________________________________ 还有谁能给我个更详细的答案啊,谢谢,最好写出控件的布局 __________________________________________________________________________ 1题:在窗体上
添加一个按钮和一个Label,然后再按钮下写如下
代码 Dim i As Integer,Sum As Integer i = 0 : Sum = 0 Do While Sum <= 1000 i += 1 Sum + = i ^ 2 Loop Label1.Text = i 2题:控件和1题一样 Static i As Integer Dim Sum As Integer,j As Integer i = 0 : Sum = 0 : j = 0 Do While j > = 0 And i <= 10 Sum = Sum + j j = Input
Box( 请输入一个整数,Input a Number ) i += 1 Loop Label1.Text = Sum __________________________________________________________________________ 1题:在窗体上
添加一个按钮和一个Label,然后再按钮下写如下
代码 Dim i As Integer,Input a Number ) i += 1 Loop Label1.Text = Sum __________________________________________________________________________ 谢谢你(nymphlucky(一小二过)的相助,你的QQ多少啊?有空再请教你啊 __________________________________________________________________________ QQ联系不上本人,就上CSDN吧。呵呵!!! __________________________________________________________________________
原文链接:https://www.f2er.com/vb/263433.html