Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Monday, 14 November 2016

URI-1044

URI Online Judge | 1044

Multiples

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem link Click here
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


Solution...

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

No comments:

Post a Comment