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 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.