class Main {
public static int[] get_summ_and_diff(int x, int y){
int summ = x + y;
int diff = x - y;
return new int[]{summ, diff};
}
public static void main(String[] args) throws Exception {
int[] diff_and_summ = get_summ_and_diff(10, 5);
System.out.println(diff_and_summ[0]);
System.out.println(diff_and_summ[1]);
// Вывод :
// 15
// 5
}
}
#java
Подписывайтесь на канал 👉@coddy_academy