Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3. int a,b;
  4. scanf("%d%d",&a,&b );
  5. while(b!=0 && a!=0){
  6. if(a>b){
  7. a=a%b;
  8. }
  9. else{
  10. b=b%a;
  11. }
  12. }
  13. if(a==0){
  14. printf("%d",b);
  15. }
  16. else{
  17. printf("%d",a);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement