Competitive Programming Solutions

GitHub
back to dashboard

F. Multiplication table

Codeforces - Sheet #2 (Loops) · limit: 1s · memory: 64MB · view on codeforces

input

1

output

1 * 1 = 1
1 * 2 = 2
1 * 3 = 3
1 * 4 = 4
1 * 5 = 5
1 * 6 = 6
1 * 7 = 7
1 * 8 = 8
1 * 9 = 9
1 * 10 = 10
1 * 11 = 11
1 * 12 = 12
Main.java
static void solve() {

        // Write your solution here
        int n = in.nextInt();
        for(int i = 1; i <= 12; i++){
            out.println(n+" * "+i+" = "+i*n);
        }
    }