回 帖 发 新 帖 刷新版面

主题:[讨论]报数游戏

报数游戏:a,b,c,d,e,f,g,h8人站成一排,如图所示报数,任意输入一个正整数,谁报到该数?
A    B    C    D    E    F    G    H
1    2    3    4    5    6    7    8
15   14   13   12   11   10   9
     16   17   18   19   20   21  22
29   28   27   26   25   24   23
     30   31   32   33   34   35  36
?????????!!!!!!!!
 
[em18][em1]

回复列表 (共12个回复)

11 楼

千穿万穿,马屁不穿,楼主把我捧得很开心,
以后有什么问题,尽管提出来,我帮你解决.(呵呵,这口也开得太大了)

C++也很精彩,但也很无奈.
概念这东西,要能理解,要能有选择的运用.还得看看实际情况,多方面对比.

12 楼

cls
input n
dim b$(8)
for i=1 to 8:read b$(i):next i
data A,B,C,D,E,F,G,H
k=-1:m=0
do
  if k=-1 then
   for i=1 to 8
      m=m+1
      if m=n then print b$(i)
    next i
    for i=7 to 1 step -1
      m=m+1
      if m=n then print b$(i):exit do
    next i:K=0
  else
    for i=2 to 8
      m=m+1
      if m=n then print b$(i):exit do
    next i
    for i=7 to 1 step -1
      m=m+1
      if m=n then print b$(i):exit do
    next i
   end if
loop
end

我来回复

您尚未登录,请登录后再回复。点此登录或注册