solution of 9A

Revision en1, by maoxiantongxue, 2021-02-04 11:44:36

It it an easy problem. We just need to write the "gcd" function first. Here is the code. ~~~~~


using namespace std; int gcd(int x, int y){ if(x%y==0) return y; else return gcd(y,x%y); } int main(){ int Y,W,D,big,small,a; cin>>Y>>W; if(Y-W>0){ big=Y; small=W; } else{ big=W; small=Y; } D=6-big+1; a=gcd(D,6); D=D/a; cout<<D<<"/"<<6/a<<endl; return 0; } ~~~~~


  Rev. Lang. By When Δ Comment
en1 English maoxiantongxue 2021-02-04 11:44:36 444 Initial revision (published)