Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int divizor (int a , int b , int c)
  5. {
  6. int nr=0,d=1;
  7. while(d<=a/2 && d<=b/2 && d<=c/2)
  8. {
  9. if(a%d==0 && b%d==0 && c%d==0)
  10. {
  11. nr++;
  12. d++
  13. }
  14. else
  15. d++;
  16. }
  17. return nr;
  18. }
  19. int main()
  20. {
  21. int a,b,c;
  22. cout<<"a=";cin>>a;
  23. cout<<"b=";cin>>b;
  24. cout<<"c=";cin>>c;
  25. cout<<divizor(a,b,c);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement