Codeforces 122A. Lucky Division Solution

Solve in C++:

#include<iostream>
using namespace std;
int main(){

int n;
while(cin>>n)
{
    if(((n%4)==0)||((n%7)==0)||((n%47)==0)||((n%74)==0)||((n%474)==0)||((n%447)==0)||((n%774)==0)||((n%777)==0)||((n%444)==0)||((n%44)==0)||((n%77)==0)||((n%477)==0))
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
    n=0;
}

}

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.