如果发现广告等破坏行为,请尽量将条目恢复到较早的版本而不是把相应内容直接删除,谢谢合作。

Talk:USACO/ride/中文翻译

来自"NOCOW"

跳转到: 导航, 搜索

var

       s,t,w:string;
       i,j,m,n,l,k,z:longint;
procedure make(w:string);
       begin
               if w='A' then
                       l:=l*1;
               if w='B' then
                       l:=l*2;
               if w='C' then
                       l:=l*3;
               if w='D' then
                       l:=l*4;
               if w='E' then
                       l:=l*5;
               if w='F' then
                       l:=l*6;
               if w='G' then
                       l:=l*7;
               if w='H' then
                       l:=l*8;
               if w='I' then
                       l:=l*9;
               if w='J' then
                       l:=l*10;
               if w='K' then
                       l:=l*11;
               if w='L' then
                       l:=l*12;
               if w='M' then
                       l:=l*13;
               if w='N' then
                       l:=l*14;
               if w='O' then
                       l:=l*15;
               if w='P' then
                       l:=l*16;
               if w='Q' then
                       l:=l*17;
               if w='R' then
                       l:=l*18;
               if w='S' then
                       l:=l*19;
               if w='T' then
                       l:=l*20;
               if w='U' then
                       l:=l*21;
               if w='V' then
                       l:=l*22;
               if w='W' then
                       l:=l*23;
               if w='X' then
                       l:=l*24;
               if w='Y' then
                       l:=l*25;
               if w='Z' then
                       l:=l*26;
       end;

begin

       assign(input,'ride.in');reset(input);
       assign(output,'ride.out');rewrite(output);
       readln(s);
       readln(t);
       m:=length(s);
       n:=length(t);
       l:=0;
       for i:=1 to m do
               make(s[i]);
       k:=l mod 47;
       l:=0;
       for i:=1 to n do
               make(t[i]);
       z:=l mod 47;
       if k=z then
               writeln('GO')
       else
               writeln('STAR');
       close(input);
       close(output);

end.

个人工具