我的可能是没事找事......
2025-02-27 21:12:58
发布于:上海
1阅读
0回复
1点赞
#include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(m<n){m=n+m;n=m-n;m=m-n;}
while(m%n!=0){
m=m%n;
if(m<n){m=n+m;n=m-n;m=m-n;}
}
cout <<n;
return 0;
}
这里空空如也
2025-02-27 21:12:58
发布于:上海
#include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(m<n){m=n+m;n=m-n;m=m-n;}
while(m%n!=0){
m=m%n;
if(m<n){m=n+m;n=m-n;m=m-n;}
}
cout <<n;
return 0;
}
这里空空如也
有帮助,赞一个