View Code of Problem 69


import java.util.Scanner;



public class Main {
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int x=scanner.nextInt();
		int result=0;
		if (x<1) {
			result=x;
		}else if (x<10) {
			result=2*x-1;
		}else if (x>=10) {
			result=3*x-11;
		}
		System.out.println(result);
	}
}

Double click to view unformatted code.


Back to problem 69