Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main
- {
- public static void main(String[] args) {
- int n = 10;
- int[] array = new int[n];
- for (int i = 0; i < n; i++) { array[i] = i + 1; }
- int delnum = (int) (Math.random() * n + 1);
- System.out.println("Удалённое число: " + delnum + "\nМассив: ");
- for (int i = 0; i < n; i++)
- {
- if(array[i] != delnum)
- {
- System.out.println("[" + i + "] = " + array[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement