Skip to main content
Search Here for Solutions
URI Problems Solved || 2060 || Bino's Challenge - URI-Online-Judge-Problems-Solution
|
Solve - 2060 - URI |
/*****Try Yourself first **********/
Solve/Solution in c++:
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int num,num5=0,num2=0,num3=0,num4=0;
cin>>num;
for(int i=1;i<=num;i++){
int x;
cin>>x;
if(x%2 == 0){
num2=num2+1;
}
if(x%3 == 0){
num3=num3+1;
}
if(x%4 == 0){
num4=num4+1;
}
if(x%5 == 0){
num5=num5+1;
}
}
cout<<num2<<" Multiplo(s) de "<<2<<endl;
cout<<num3<<" Multiplo(s) de "<<3<<endl;
cout<<num4<<" Multiplo(s) de "<<4<<endl;
cout<<num5<<" Multiplo(s) de "<<5<<endl;
}
https://russelltheprogrammer.com/category/uri-online-judge/
Comments
Post a Comment
Thanks for your message