回 帖 发 新 帖 刷新版面

主题:请教几个编程题,有急用,谢谢!

1.编写程序实现在屏幕上显示菱形星阵,菱形的行数根据输入的数决定,若输入4则第4行上的星号数量最多。输入4时会显示如图所示的菱形星阵。

2.编写程序删除字符串中的空格,字符串为“Long long ago, there was a war between the birds and the beasts. No one knows what they fought about.The bat did not know whose side he should take. He thought and thought, then decided he must try to be on the side of the winners.So he watched from far away. After a while, it seemed that the birds were going to win.He flew over to join them.”。提示:直接使用TRIM函数是无效的。

3.编写程序显示满足如下要求的三位的整数:能被11整除且包含数字8,要求显示所有满足条件的数,并显示满足要求数的个数。

4.编写程序实现以下功能:显示1992年到2020年中的闰年年份。

回复列表 (共3个回复)

沙发

PARAMETERS x
n=2*x-1
FOR i = 1 TO x
    m=REPLICATE("*",2*i-1)
    ?PADC(m,n," ")
NEXT

FOR i = 1 TO x-1
    m=REPLICATE("*",2*(x-i)-1)
    ?PADC(m,n," ")
NEXT

板凳


n=0
c=''

for i=100 to 999
    if i%11=0
        for j=1 to 3
            if subs(str(i,3),j,1)='8'
                n=n+1
                c=c+str(i,3)+"、"
                exit
            endif
        endfor
    endif
endfor
clea
?"符合条件的共有"+str(n,3)+"个数,分别是:"+left(c,len(alltrim(c))-2)

3 楼

你好.我是全职网赚工作者.
如果你有时间有电脑.
想在网络上创业.请联系我..
项目绝对真实.详情QQ空间资料
加盟请联系 QQ908889846
2010年,中国网民突破了4亿,网络游戏玩家超过了3亿,
互联网即将进入全民网游的时代

我来回复

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