http://codeforces.com/contest/9

A

gcd水题

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define sqr(x) ((x)*(x))
 6 #define maxn 1000010
 7 typedef long long ll;
 8 /*#ifndef ONLINE_JUDGE
 9         freopen("1.txt","r",stdin);
10 #endif */
11 int gcd(int a,int b){
12     if(b==0) return a;
13     return gcd(b,a%b);
14 }
15 
16 int main(){
17     #ifndef ONLINE_JUDGE
18       //  freopen("1.txt","r",stdin);
19     #endif
20     int n,m;
21     cin>>n>>m;
22     n=max(n,m);
23     int fz=6-n+1;
24     int fm=6;
25     int d=gcd(fz,fm);
26    // cout<<fz<<" "<<fm<<endl;
27     cout<<fz/d<<"/"<<fm/d<<endl;
28 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-21
  • 2021-12-25
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案