daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool pierwsza(long long a)
  6. {
  7.     if(a<2) return false;
  8.  
  9.     for(long long i=2; i*i<=a; i++)
  10.         if(a%i==0)
  11.             return false;
  12.      return true;
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18.     long long  n;
  19.     cin>>n;
  20.     for(long long i=1; i<=n; i*=10){
  21.         long long c;
  22.         c=n/i;
  23.         long long  d;
  24.         d=n%i;
  25.         if(d<i/10) continue;
  26.         if(pierwsza(d)&&pierwsza(c)) {cout<<"TAK" ; return 0;}
  27.     }
  28.     cout<<"NIE";
  29.         return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top