嵌套For循环以填充矩阵 [英] Nested For Loop to populate matrix

查看:74
本文介绍了嵌套For循环以填充矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是一门入门课程,但我最难理解如何解决这个问题。通过点击一个按钮,它应该具有以下输出:


0 1 2 3 4

5 6 7 8 9

10 11 12 13 14

15 16 17 18 19

20 21 22 23 24

25 26 27 28 29

30 31 32 33 34

35 36 37 38 39

40 41 42 43 44

45 46 47 48 49


5行数10行10行。我知道我们需要使用两个For Statements并且应该使用回车'但是我知道它是'更容易使用vbnewline这是好的。当然我有一个类似的例子,但显然我只保存了项目而不是代码... = /


任何帮助都将不胜感激!

So this is an introductory course, but i''m having the hardest time understanding how to do this problem. By clicking on one button it''s supposed to have the following output:

0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
25 26 27 28 29
30 31 32 33 34
35 36 37 38 39
40 41 42 43 44
45 46 47 48 49

Five numbers a line for 10 lines.I know we''re required to use two For Statements and supposed to use carriage return-line''s but I know it''s easier to use vbnewline which is ok. Of course I had an example that was similar but apparently i only saved the project and not the code...=/

Any help would be greatly appreciated!

推荐答案

本网站的专家非常乐意帮助您解决问题,但他们无法为您完成任务/计划。首先尝试自己的作业/计划并发布有关您遇到的任何困难或有关您不知道如何实现的特定代码功能的问题。


请阅读< a href =http://www.thescripts.com/forum/faq.php?faq=posting_guidelines\"target =_ blank>发布指南,特别是课程作业发布指南


然后当你准备好发布一个新的这个帖子中的问题。


MODERATOR
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don''t know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

MODERATOR


我只能想出这个..只需修改它..
I can only come up with this.. Just modify it..

展开 | 选择 | Wrap | 行号


对不起,如果我的措辞有误导性,我绝不会找人告诉我答案,我已经当我有我的榜样时,我一直在尝试并且有了更好的理解,但我不再了!


到目前为止我所说的是


Dim" name"作为整数


我知道我需要创建一个For语句,所以我需要使用2个变量,例如x和x。和y,就像x = 0到49一样简单,y =如果x不等于......那么+1?
Sorry if my wording was misleading, i''m by no means looking for someone to tell me the answer, I''ve been attempting and had a much better understanding when I had my example but i don''t anymore!

What I have so far is stating

Dim"name" as integer

I know I need to create a For statement, so I need to use 2 variables such as "x" and "y", is it as simple as x= 0 to 49 and y= something like if x doesn''t equal...then +1?


这篇关于嵌套For循环以填充矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆