/
IvanovGeorgiy
/
Pract
Обзор
Документация
Войти
/
IvanovGeorgiy
/
Pract
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Pract7/src/Main.java
22 строки
993 B
Selectel Git User
first_commit
20 окт 2024, 13:23
20 окт 2024, 13:23
916f77b
Код
Авторство
О чём код?
import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Hello world!"); MathCalculable f = new MathFunc(); System.out.println("Выберите функцию\n1. Найти длину окружности \n2. Найти степень числа"); Scanner sc = new Scanner(System.in); int ans = sc.nextInt(); if (ans == 1){ System.out.println("Введите радиус: "); int r = sc.nextInt(); System.out.println("Длина окружности: " + f.circleLength(r)); }else{ System.out.println("Введите число, которое надо возвести в степень: "); int a = sc.nextInt(); System.out.println("Введите степень: "); int b = sc.nextInt(); System.out.println("Длина окружности: " + f.po(a, b)); } } }