无限循环的问题 [英] problem with infinite loop

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

问题描述

你好,我有一个无限循环问题。

我有4个数组,每个数组都有5个整数

元素来自随机数字,我不想在数组中使用相同的元素,所以我在第18行中创建了一个if。问题:有时候代码会打印出d [i]的5个元素,有时则没有(它开始运行但是它什么都不做 - 我认为这是一个无限循环)

展开 | 选择 | Wrap | 行号

解决方案

< blockquote class =post_quotes>
你好,呃ave一个无限循环的问题。

我有4个数组,每个数组都有5个整数

元素来自随机数字,我不想要在数组中有相同的元素,所以我在第18行中创建一个if。问题:有时候代码会打印出d [i]的5个元素,而有些时候不会(它开始运行但它不会没有任何事情 - 我认为这是一个无限循环)

展开 | 选择 | Wrap | 行号



1第16-25行的循环就像是令牌ing:

展开 | 选择 | Wrap | 行号


如果数组有五个元素,则五个索引值分别为0,1,2,3和4那么5就远了。


亲切的问候,


Jos


Hello, i have a problem with an infinite loop.
I have got 4 arrays , each of them, have 5 integers
the elements are from random funtcion, I don''t want to have same elements in the arrays so i make an if in line 18.The problem:some times the code prints me the 5 elements of d[i] and some times not(it starts to run but it doesn''t do no anything- i think tha is an infinite loop)

Expand|Select|Wrap|Line Numbers

解决方案

Hello, i have a problem with an infinite loop.
I have got 4 arrays , each of them, have 5 integers
the elements are from random funtcion, I don''t want to have same elements in the arrays so i make an if in line 18.The problem:some times the code prints me the 5 elements of d[i] and some times not(it starts to run but it doesn''t do no anything- i think tha is an infinite loop)

Expand|Select|Wrap|Line Numbers


1.The loop on line numbers 16-25 is like writing:

Expand|Select|Wrap|Line Numbers


If an array has five elements, the five index values are 0, 1, 2, 3 and 4. so 5 is far out.

kind regards,

Jos


这篇关于无限循环的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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