/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication5;

import java.util.Scanner;

/**
 *
 * @author joelx
 */
public class JavaApplication5 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("entrez deux nombres dont vous volez multiplier");
        int x,n;
        int p =0;
        x  = scan.nextInt();
        n =  scan.nextInt();
        boolean changeSigne = false;
        if (x < 0) {
            changeSigne = true;
            x = -x;
        }
        for (int i = 0; i < x; ++i) 
            p += n;           // 0 + a + a + ... + a (b fois)
        if (changeSigne) 
            p = -p;
        System.out.println("Le produit est: " + p);
    }
    

}
        // TODO code application logic here
    
    

