Wikioi 1012

来源:互联网 发布:淘宝买简历模板 编辑:程序博客网 时间:2024/06/06 02:49
var x,y,p,q,t,tt,s,i,j:longint;function gcd(a,b:longint):longint;beginif b=0 then gcd:=a else gcd:=gcd(b,a mod b);end;function gbs(a,b:longint):longint;begingbs:=a*b div gcd(a,b);end;begin  readln(x,y);s:=0;  if (y mod x<>0) then writeln(0)  else  begin    for i:=x to y do    begin      for j:=i to y do      begin        t:=gcd(i,j); tt:=gbs(i,j);        if (t=x) and (tt=y) then        begin s:=s+1;        end;      end;    end;    writeln(s*2);  end;end.//Copyright (C) 2014 wikioi user12923 All rights reserved  

0 0
原创粉丝点击