国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

P1538 迎春舞會之數字舞蹈

2019-11-11 07:13:49
字體:
來源:轉載
供稿:網友

題目描述

給出數字的大小k,用“ ”、“-”和“|”組成一系列數字。

樣例輸入

21234567890

樣例輸出

-- -- -- -- -- -- -- -- | | | | | | | | | | | | | || | | | | | | | | | | | | | -- -- -- -- -- -- -- | | | | | | | | | | | | || | | | | | | | | | | | | -- -- -- -- -- -- --

思路

相信也看出來了,這就是一個水題啊~~~不過注意空格的個數,數字兩兩之間存在一個空格。var a:string; i,j,k,l,n:longint;begin readln(n); readln(a); for i:=1 to length(a) do begin write(' '); if (a[i]='1')or(a[i]='4') then for j:=1 to n do write(' ') else for j:=1 to n do write('-'); write(' '); end; writeln; for i:=1 to n do begin for j:=1 to length(a) do begin if (a[j]='1')or(a[j]='2')or(a[j]='3')or(a[j]='7') then begin for k:=1 to n+1 do write(' '); write('| '); end else if (a[j]='5')or(a[j]='6') then begin write('|'); for k:=1 to n+2 do write(' '); end else begin write('|'); for k:=1 to n do write(' '); write('| '); end; end; writeln; end; for i:=1 to length(a) do begin write(' '); if (a[i]='1')or(a[i]='7')or(a[i]='0') then for j:=1 to n do write(' ') else for j:=1 to n do write('-'); write(' '); end; writeln; for i:=1 to n do begin for j:=1 to length(a) do begin if (a[j]='1')or(a[j]='3')or(a[j]='4')or(a[j]='5')or(a[j]='7')or(a[j]='9') then begin for k:=1 to n+1 do write(' '); write('| '); end else if a[j]='2' then begin write('|'); for k:=1 to n+2 do write(' '); end else begin write('|'); for k:=1 to n do write(' '); write('| '); end; end; writeln; end; for i:=1 to length(a) do begin write(' '); if (a[i]='1')or(a[i]='4')or(a[i]='7') then for j:=1 to n do write(' ') else for j:=1 to n do write('-'); write(' '); end; writeln;end.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 红桥区| 连城县| 连南| 黎城县| 普洱| 白沙| 江油市| 小金县| 玉门市| 卓尼县| 萍乡市| 专栏| 秦皇岛市| 林芝县| 东宁县| 雷州市| 平遥县| 城市| 永城市| 孝昌县| 宁河县| 广宁县| 唐海县| 龙南县| 庐江县| 宾阳县| 阳高县| 图木舒克市| 定安县| 黄冈市| 农安县| 北辰区| 布拖县| 宁德市| 涿州市| 彭山县| 文安县| 晋宁县| 扎鲁特旗| 方城县| 左贡县|