Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int a,b;
- scanf("%d%d",&a,&b );
- while(b!=0 && a!=0){
- if(a>b){
- a=a%b;
- }
- else{
- b=b%a;
- }
- }
- if(a==0){
- printf("%d",b);
- }
- else{
- printf("%d",a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement