ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#167261 | #1260. 化简分数 | struct | 100 | 0ms | 1184kb | C++ | 256b | 2023-01-01 22:24:09 | 2023-01-01 22:24:09 |
answer
//There's the KPEN code.
#include<bits/stdc++.h>
using namespace std;
//开始进入C++的世界
int x,y;
int r;
int main() {
cin>>x>>y;
int a=x,b=y;
while(x%y!=0) {
r=x%y;
x=y;
y=r;
}
printf("%d/%d",a/y,b/y);
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 33
Accepted
time: 0ms
memory: 1180kb
input:
24 64
output:
3/8
result:
ok single line: '3/8'
Test #2:
score: 33
Accepted
time: 0ms
memory: 1180kb
input:
5 9
output:
5/9
result:
ok single line: '5/9'
Test #3:
score: 33
Accepted
time: 0ms
memory: 1184kb
input:
156 568
output:
39/142
result:
ok single line: '39/142'