Aleksandr_Grigoryev

CW 07.12.2017

Dec 7th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. void NOD(int m,int n)
  5. {
  6. while(m!=0 && n!=0)
  7. {
  8. if (m>n)
  9.     m=m%n;
  10. else n=n%m;
  11. }
  12. cout<<"NOD"<<m+n;
  13. }
  14. int main()
  15. {
  16. int b,x,l,y;
  17. float a=0;
  18. cin>>x;
  19. for(int i=1;i<=x;i++)
  20. {
  21. if(x%i==0)
  22. {  
  23.     a=sqrt(i);
  24.     if (a==int(a))
  25.         y=x/i;
  26.     }
  27. }
  28. cout<<"a'="<<y;
  29. system("pause");
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment