斯诺登的密码

var
 a:array[1..6]of string;
 s,ss,t:string;
 x:char;
 n,i,j,b:longint;
begin
 while x<>'.' do
 begin
  read(x);
  s:=s+x;
 end;
 for i:=1 to 6 do
 begin
  b:=pos(' ',s);
  ss:=copy(s,1,b-1);
  if (ss='zero')then a[i]:='00';
  if (ss='one')or(ss='a')or(ss='another')or(ss='first') then a[i]:='01';
  if (ss='two')or(ss='both')or(ss='second') then a[i]:='04';
  if (ss='three')or(ss='third') then a[i]:='09';
  if (ss='four') then a[i]:='16';
  if ss='five' then a[i]:='25';
  if ss='six' then a[i]:='36';
  if ss='seven' then a[i]:='49';
  if ss='eight' then a[i]:='64';
  if ss='nine' then a[i]:='81';
  if ss='ten' then a[i]:='00';
  if ss='eleven' then a[i]:='21';
  if ss='twelve' then a[i]:='44';
  if ss='thirteen' then a[i]:='69';
  if ss='fourteen' then a[i]:='96';
  if ss='fifteen' then a[i]:='65';
  if ss='sixteen' then a[i]:='56';
  if ss='seventeen' then a[i]:='89';
  if ss='eighteen' then a[i]:='24';
  if ss='nineteen' then a[i]:='61';
  if ss='twenty' then a[i]:='00';
  delete(s,1,b);
 end;
 for i:=1 to 5 do
  for j:=i+1 to 6 do
 if a[i]>a[j] then
 begin
  t:=a[i];
  a[i]:=a[j];
  a[j]:=t;
 end;
 s:='';
 for i:=1 to 6 do
  s:=s+a[i];
 i:=1;
 if s='' then write(0);
 while (s[i]='0')and(i<length(s)) do
 inc(i);
 for j:=i to length(s) do
 write(s[j]);
end.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值