Name That Number答案pascal usaco

来源:百度知道 编辑:UC知道 时间:2024/05/07 06:24:04

program NameThatNumber;
var
No,name:string;
f:text;
i,total:integer;
t:char;
b:boolean;
begin
assign(input,'namenum.in');
reset(input);
readln(No);
close(input);
b:=false;
assign(f,'dict.txt');
reset(f);
assign(output,'namenum.out');
rewrite(output);
total:=0;
while not eof(f) do
begin
readln(f,name);
b:=true;
if length(name) = length(no) then
for i:=1 to length(name) do
begin
case name[i] of
'A'..'C': t:='2';
'D'..'F': t:='3';
'G'..'I': t:='4';
'J'..'L': t:='5';
'M'..'O': t:='6';
'P','R','S'