[URI Online Judge] – 1044 – Multiples

Read two 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.


The input has two integer numbers.


Print the message relative to the input as stated above.

Sample Input Sample Output
6 24 Sao Multiplos
6 25 Nao sao Multiplos


#include <cstdio>
int main(){
 int a, b;
 scanf("%d %d", &a, &b);
 if (a % b == 0 || b % a == 0)
 printf("Sao Multiplos\n");
 printf("Nao sao Multiplos\n");
 return 0;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s