Facebook
From dada, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 249
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. int main()
  5. {
  6.         int n;
  7.         int d=1;
  8.         int wynik=1;
  9.         cout<<"Podaj liczbe: "<<endl;
  10.         cin>>n;
  11.         while (d<n)
  12.         {
  13.                 if(n%d==0)
  14.                 {
  15.                
  16.                
  17.         wynik=wynik*d;
  18.                 }
  19.                
  20.                 d++;
  21.         }
  22.         if(wynik==n)
  23.         {
  24.                 cout<<"TAK";
  25.         }
  26.         else
  27.         {
  28.                 cout<<"NIE";
  29.         }
  30.  
  31.        
  32.         return 0;
  33. }