vj1318 Jam的计数法

Vj1318 Jam的计数法

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //µÝ¹é //´ÓµÚһλ¿ªÊ¼Ë³´Îö¾Ù ö¾ÙÍê×îºóһλ¾ÍÊä³ö / //´óÅ£µÄºÃ·½·¨ //Ïȵõ½×îºóÒ»¸öJamÊý //´Ó×îºóÍùÇ°Åжϵ±Ç°Êý Èç¹ûµ±Ç°Êý¸ÃλСÓÚ×îºóÒ»¸öÊýµÄ¸Ãλ Ôò¸Ãλ¿ÉÒÔ+1 ºóÃæµÄËùÓÐλ¶¼ÎªÇ°Ò»Î»+1 //ÒòΪÊÇ´ÓºóÍùÇ°ÅÐ¶Ï ËùÒÔ±£Ö¤ÁË˳Ðò / var s,t,w,tot:integer; now,last:string[26]; procedure main; var i,j:integer; begin readln(s,t,w); readln(now); for i:=1 to w do last:=chr(97+t-i)+last; while (tot<5) and (now<>last) do begin for i:=w downto 1 do if now[i]<last[i] then begin now[i]:=chr(ord(now[i])+1); for j:=i+1 to w do now[j]:=chr(ord(now[j-1])+1); inc(tot);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Vj1318 Jam&ccedil;š„&egrave;&reg;&iexcl;&aelig;•&deg;&aelig;&sup3;•

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online