Skip navigation.

ConcreteVitamin的小石屋

ConcreteVitamin's House

[USACO]打响第一炮,The war of the USACO&me has just began!

从今征战USACO!
原题http://ace.delos.com/usacoprob2?a=bJQzu0EjihH&S=ride
译题http://www.oibh.org/bbs/viewthread.php?tid=10391&extra=page%3D1
Code
{
ID:yangzon1
PROG:ride
LANG:PASCAL
}
program ride;
var
  star,team:string;
  a,b,i:longint;
begin
  a:=1;
  b:=1;
  assign(input,'ride.in');
  reset(input);
  readln(star);
  readln(team);
  close(input);
  for i:=1 to length(star) do
    a:=a*(ord(star[i])-64);
  for i:=1 to length(team) do
    b:=b*(ord(team[i])-64);
  assign(output,'ride.out');
  rewrite(output);
  if a mod 47=b mod 47 then
    write('GO')
  else write('STAY');
  writeln;
  close(output);
end.

注意事项
·在输入输出文件的末尾换行
·程序起始处加上信息

五一的部分作业,可看作考试报告……

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31