Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Task3 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.print("x: ");
- int x = scanner.nextInt();
- int f = 0;
- if (x < 0) {
- f = 4 * x - 1;
- } else if (x > 0) {
- f = 25 * x + 10;
- } else if (x == 0) {
- f = 0;
- }
- System.out.println("F " + f);
- scanner.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement