Tuesday, January 21, 2020

Codeforces 122A Lucky Division Solution in C


  1. ///SHS
  2. #include <iostream>
  3. using namespace std;
  4. int main ()
  5. {
  6. int i,j,k,a[]={4,7,44,47,77,444,447,477,777};
  7. cin>>k;
  8. for (i=0;i<9;i++)
  9. {
  10. if (k%a[i]==0)
  11. {
  12. cout<<"YES"<<endl;
  13. return 0;
  14. }
  15. }
  16. cout<<"NO"<<endl;
  17. return 0;
  18. }

No comments:

Post a Comment

Codeforces 131A cAPS lOCK Solution in C

#include <stdio.h> int main () { char ch [ 106 ]; int i , j , ck = 1 ; scanf ( "%s" , ch ); ...