Competitive Programming Solutions

GitHub
back to dashboard

C. Simple Calculator

Codeforces - Sheet #1 (Data type - Conditions) · limit: 1s · memory: 256MB · view on codeforces

input

5 10

output

5 + 10 = 15
5 * 10 = 50
5 - 10 = -5
Main.java
static void solve() {

        // Write your solution here
        int a = in.nextInt();
        int b = in.nextInt();
        out.println(a+" + "+b+" = "+(a+b));
        out.println(a+" * "+b+" = "+(long)(a*b));
        out.println(a+" - "+b+" = "+(a-b));
    }