Advertisement
askarulytarlan

№148 НОД

Sep 18th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. #include <vector>
  4. #include <fstream>
  5. #include <map>
  6. #include <algorithm>
  7.  
  8.  
  9. using namespace std;
  10. int main(){
  11. int a;
  12. int c;
  13. int b;
  14. cin>>a>>b;
  15. for (int i=1;i<=a;i++){
  16. if(a%i==0){
  17. c=a/i;
  18. c=c;
  19. }
  20. }
  21. if(b%c==0){
  22. cout<<c<<endl;
  23. return 0;
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement