作者:手机用户2602882697 | 来源:互联网 | 2023-05-17 20:56
mymainproblemistheprogrammustntallowtheusertoinputonlythesamedigitduringalltheti
my main problem is the program mustn't allow the user to input only the same digit during all the times the program asks for a value.
我的主要问题是程序在程序要求输入值的所有时间内都不允许用户只输入相同的数字。
for example, the user needs to input values 9 times, and the user only inputs "1" as a value 9 times, the program must take this as an error, meaning there should be variety.
例如,用户需要输入值9次,而用户只输入“1”作为值9次,程序必须将此作为错误,这意味着应该有多种。
although, the user can still input the same values sometimes, but not ALL THE TIME. The user can enter "1" 2x, 3x, 4x, etc, but not 9x.
尽管如此,用户有时仍然可以输入相同的值,但不是所有时间。用户可以输入“1”2x,3x,4x等,但不能输入9x。
for example:
these can be allowed:
这些可以被允许:
enter digit 1: 1
enter digit 2: 2
enter digit 3: 1
enter digit 4: 1
enter digit 5: 3
enter digit 6: 5
enter digit 7: 5
enter digit 8: 5
enter digit 9: 5
输入数字1:1输入数字2:2输入数字3:1输入数字4:1输入数字5:3输入数字6:5输入数字7:5输入数字8:5输入数字9:5
however, these can't be allowed: enter digit 1: 1
enter digit 2: 1
enter digit 3: 1
enter digit 4: 1
enter digit 5: 1
enter digit 6: 1
enter digit 7: 1
enter digit 8: 1
enter digit 9: 1
但是,这些不允许:输入数字1:1输入数字2:1输入数字3:1输入数字4:1输入数字5:1输入数字6:1输入数字7:1输入数字8:1输入数字9:1
int [][]array=new int [aa][aa];
for the inputting part:
输入部分:
for (row=0;row
proceeding after this, the checking if all entered values are all the same should be performed
在此之后,应检查是否所有输入的值都相同
3 个解决方案