Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.*;
- public class Main {
- public static void main (String[] args){
- int[] arr = {12, 3, 48, 133, 88};
- Scanner in = new Scanner(System.in);
- int input = 0;
- String arout = Arrays.toString(arr);
- System.out.println("Счет с нуля.");
- System.out.println(arout);
- System.out.println("Введите id : ");
- input = in.nextInt();
- System.out.println(" Увеличено - " + sum(arr, input));
- }
- public static double sum(int arr[], int input ){
- double ar = arr[input];
- double total = 0;
- double buf = 0;
- //input 2
- buf = ar / 100;//48 / 100 = 0.48
- buf = buf * 10;//0.48 * 10 = 4.8
- total = ar + buf;
- return total;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement