eolymp
bolt
Try our new interface for solving problems
Problems

Use sub-program

published at 4/3/24, 2:13:39 am

import java.util.Scanner;

public class Main { public static void func(double a, double b) { double c = a + b; double d = a * b; System.out.printf("%.4f %.4f\n", c, d); }

public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int c = scanner.nextInt(); for (int i = 0; i < c; i++) { double a = scanner.nextDouble(); double b = scanner.nextDouble(); func(a, b); } scanner.close(); } }