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 Sample | Output Sample |
6 24 | Sao Multiplos |
6 25 | Nao 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 commentsTo know more about the problem, give us your valuable commment. We'll try to help you. Thanks