Ява:
import java.util.Scanner;
public class Znaniya {
public static void main(String[] args) { System.out.println("Введите значение х:"); Scanner sc = new Scanner(System.in); double x = sc.nextDouble(); if (x>=0) System.out.println("f(x) = " + x); else System.out.print("f(x) = " + (-x)); } }