Saturday, April 30, 2016

URI 1044 Solution in C Java language || Multiples




URI Online Judge | 1044

Multiples

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Read two nteger values (A and B). After, the program should print the message "Sao Multiplos" (are multiples) or "Nao sao Multiplos" (aren’t multiples), corresponding to the read values.

Input

The input has two integer numbers.

Output

Print the relative message to the input as stated above.
Input SampleOutput Sample
6 24Sao Multiplos
6 25Nao sao Multiplos

URI 1044 Solution in Java language || Triangle Types

import java.io.IOException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws IOException {

        int A, B;
Scanner input =new Scanner(System.in);
A = input.nextInt();
B = input.nextInt();
if (B % A == 0 || A % B == 0) {
System.out.print("Sao Multiplos\n");
}else {
System.out.print("Nao sao Multiplos\n");
}

    }

}

URI 1044 Solution in C language || Triangle Types



#include<stdio.h>

    int main(){

        int A, B;
scanf("%d%d", &A,&B);
if (B % A == 0 || A % B == 0) {
printf("Sao Multiplos\n");
}else {
printf("Nao sao Multiplos\n");
}

    }



No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.