0
Hey, can anybody help me making a program hay asks for 50 values and sabe them. With tan condition fue numbers cant be repeated
3 Antworten
+ 7
So, you want to take input but can't use a scanner?
You can try to use a BufferedReader and InputStreamReader.
Example/
import java.io.BufferedReader;
import java.io.InputStreamReader;
// The required imports
BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
String input = sc.readLine();
// getting input
It is similar to a Scanner, but not quite the same.
+ 5
The question started strong, but quickly turned to gibberish. 😶
Easiest way to store 50 variables is to use an array.
Then, all you really need to do is use a loop to ask for input, and add it to the array.
If you want, instead of an array you can use a set.
A set will remove all the duplicate values for you
Set<Integer> set = new HashSet<Integer>();
0
Thanks for your reply but told them that while we could make it and another question I can not use the scanner program by which I have not enabled its can help me how to do it thanks