1 条题解
-
0
C++ :
#include<iostream> using namespace std; int main(){ int a,b,t; cin>>a>>b; if(a>b)t=b; else t=a; while(true) { if(a%t==0&&b%t==0){ cout<<"yue:"<<t; break; } t--; } return 0; }
Pascal :
var a,b,c:longint; begin readln(a,b); if a>b then c:=b else c:=a; while (a mod c<>0) or (b mod c<>0) do c:=c-1; writeln('yue:',c); end.
- 1
信息
- ID
- 1021
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者