Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7315 - Бутархайг хураа

Өгөгдсөн энгийн бутархайг хураа.

Input

Энгийн бутархайн хүртвэр, хуваарийг натурал хоёр тоо нэг зайгаар тусгаарлагдан өгөгдөнө.

Output

Хураагдсан бутархайн хүртвэр, хуваарь нь дараах хэлбэртэйгээр хэвлэгдэнэ.

хүртвэр/хуваарь

Example

Input:
9 15

Output:
3/5

Нэмсэн:Bataa
Огноо:2013-01-11
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2022-09-18 04:37:22
package s;

import java.util.Scanner;

public class ads {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner (System.in);
System.out.print("A=");
int nu1 = scan.nextInt();
System.out.print("B=");
int nu2 = scan.nextInt();
//
int b=0,a=0;
for(int i=1;i<=nu1;i++)
{
if(nu1%i==0&&nu2%i==0)
{
b=nu1/i;
a=nu2/i;
}
}

System.out.print(b+"/"+a);
scan.close();
}

}
2022-06-30 12:26:53
#include<stdio.h>
int main()
{
int a, b, i=0, c, d, e;
scanf("%d%d", &a, &b);
for(i=1; i<=a&&b; i++)
if(a%i==0&&b%i==0)
c=i;
e=a/c;
d=b/c;
printf("%d/%d", e, d);
return 0;
}
2022-05-19 10:52:07
int a,b,c,i,d,e;
cin>>a>>b;
for (i=1;i<=a && i<=b;i++){
if(a%i==0 && b%i==0)
c=i;
d=a/c;
e=b/c; }
cout<<d<<"/"<<e;
2022-03-30 11:23:36
#include<stdio.h>
int main()
{
int a, b, i=0, c, d, e;
scanf("%d%d", &a, &b);
for(i=1; i<=a&&b; i++)
if(a%i==0&&b%i==0)
c=i;
e=a/c;
d=b/c;
printf("%d/%d", e, d);
return 0;
}


huuulll alnuudaaa chingisss gang
2022-01-05 14:38:17
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
c=a;
while(true)
{
if(a%c==0 && b%c==0)break;
c--;
}
printf ("%d/%d" ,a/c ,b/c);
}
pls copy this hamgiin ez ni shuu hha bas l nodlin comment bicij bsin bn hahaha
2021-12-06 04:42:57
#include<iostream>
using namespace std;
int main () {
int A, B, a, b, c;

cin >> A >> B ;
for(int i=1; i<=A && i<=B; i++ ){
if(A%i==0 && B%i==0){
c=i;
}
}

a=A/c;
b=B/c;
cout<<a<<"/"<<b;
}
2021-11-09 07:30:58
#include <iostream>
using namespace std;
int main()
{
int a, b, tempory_a, tempory_b, a1, b1;
cin >> a;
cin >> b;
tempory_a = a;
tempory_b = b;
while(tempory_a != tempory_b)
{
if(tempory_a > tempory_b)
{
tempory_a = tempory_a - tempory_b;
}
else
{
tempory_b = tempory_b - tempory_a;
}
}
a1 = a / tempory_a;
b1 = b / tempory_b;
cout << a1 << "/" << b1;
} now i am here with CPP bcz CPP is faster than python
2021-11-09 07:21:41
try:
a, b = [int(x) for x in input().split()]
tempory_a = a
tempory_b = b
while tempory_a is not tempory_b:
if tempory_a > tempory_b:
tempory_a = tempory_a - tempory_b
else:
tempory_b = tempory_b - tempory_a

a1 = a // tempory_a
b1 = b // tempory_a
print(str(a1) + "/" + str(b1))
except ValueError as e:
print(e)
print("pls Enter integer for a and b") maybe this is fancier
2021-11-09 07:20:40
try:
a, b = [int(x) for x in input().split()]
tempory_a = a
tempory_b = b
while tempory_a is not tempory_b:
if tempory_a > tempory_b:
tempory_a = tempory_a - tempory_b
else:
tempory_b = tempory_b - tempory_a

a1 = a // tempory_a
b1 = b // tempory_a
print(str(a1) + "/" + str(b1))
except ValueError:
print("pls Enter integer for a and b") I am here with python
2021-11-08 10:11:53
huulmaargui sangdtal comment bichhima
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.