pascal 习题 阅读程序Word文档下载推荐.docx
- 文档编号:16104740
- 上传时间:2022-11-20
- 格式:DOCX
- 页数:18
- 大小:18.26KB
pascal 习题 阅读程序Word文档下载推荐.docx
《pascal 习题 阅读程序Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《pascal 习题 阅读程序Word文档下载推荐.docx(18页珍藏版)》请在冰豆网上搜索。
writeln(k:
10:
2)
0.98
第3题(6分)
n,i,t:
longint;
tem:
s:
string;
write('
Inputn:
'
);
readln(n);
='
1'
;
repeat
i:
=length(s);
whiles[i]='
do
s[i]:
='
0'
;
dec(i);
ifi>
0thens[i]:
elses:
+s;
val(s,t,tem);
untiltmodn=0;
writeln(n,'
*'
tdivn,'
s);
输入:
6
6*185=1110
第4题(6分)
constn=5;
i,j,m,s:
integer;
m:
fori:
=1tondo
=m+i;
=m;
forj:
=1to2*idowrite('
'
{'
中间是一个空格}
write(smod10:
2);
=s+j;
writeln;
12471
34693
67926
01360
56815
第5题(7分)
a:
array[0..8]ofchar;
=1to8doa[i]:
=char(i*2+ord('
A'
));
=1to4dobegin
a[0]:
=a[i];
a[i]:
=a[9-i];
a[9-i]:
=a[0];
=1to8dowrite(a[i]);
QOMKIGEC
第6题(7分)
Programyd;
n,i,x:
array[0..10]ofinteger;
fori:
read(x);
d[x]:
=d[x]+1;
d[0]:
=1to10dod[i]:
=d[i-1]+d[i];
=1to10do
ifd[i]<
>
d[i-1]thenwriteln(i:
3,d[i-1]+1:
4);
输入:
20
34617694107
66338791067
_______
11
32
45
67
712
816
917
1019
第7题(7分)
a,b:
array[1..32]ofinteger;
proceduressort(i,j:
integer);
var
m,k,x:
ifj-i>
1then
=(i+j)div2;
ssort(i,m);
ssort(m+1,j);
=i;
forx:
=itomdo
b[k]:
=a[x];
b[k+1]:
=a[m+x-i+1];
=k+2;
=itojdoa[x]:
=b[x];
=1to16doa[i]:
ssort(1,16);
=1to16dowrite(a[i]:
3);
19513311715210614412816
第8题(6分)
a,d:
array[1..100]ofinteger;
n,i,j,k,x,s:
n:
=5;
a[1]:
d[1]:
=i+1;
x:
=1ton+1-ido
=s+x;
=x+1;
a[j+1]:
=a[j]+k;
write(a[j],'
writeln('
...'
d[i+1]:
=d[i]+i;
=d[i+1];
_________
1361015...
25914...
4813...
712...
11...
第9题(7分)
const
array[0..3,1..4]ofinteger
=((4,7,10,13),(1,8,11,14),(2,5,12,15),(3,6,9,16));
i,j,a,x,k,bj:
y,u,v:
real;
=1to4do
=3-i;
bj:
=0to3do
fork:
x:
=d[j,k];
u:
=(x+a)/4;
v:
=(x+trunc(u))/4;
y:
=4*(v-trunc(v));
ify<
jthenbegink:
=4;
j:
=3;
end;
ifbj=0then
U=(X'
ifa>
0thenwrite('
+'
writeln(a,'
)/4'
U=(X-1)/4
第10题(7分)
array[1..10]ofinteger
=(8,2,7,4,6,9,3,5,3,8);
typepoint=^nod;
nod=record
w:
right,left:
point
varfirst,head:
point;
j,i,k:
procedurehyt(d:
varp:
point);
ifp=nilthen
new(p);
ifk=1thenbeginfirst:
=p;
k:
=2;
withp^do
beginw:
=d;
right:
=nil;
left:
=nilend;
end
elsewithp^do
ifd>
=wthenhyt(d,right)elsehyt(d,left);
procedurehyt1(p:
ifleft<
>
nilthenhyt1(left);
write(w:
ifright<
nilthenhyt1(right);
=10;
first:
=1toidohyt(a[j],first);
hyt1(first);
writeln
2334567889
第11题(7分)
varm,n,i,p,k:
r:
array[1..200]ofinteger;
b:
boolean;
=6;
n:
=1tom-1dor[i]:
r[m]:
i:
p:
b:
=true;
whilebdo
=r[p];
ifk=pthenbeginwriteln(p);
=falseend
elseifi=n+1then
write(p,'
r[k]:
________
421365
第12题(7分)
programyd;
varn,k,s:
longint;
=1000000000;
=0;
=1;
whiles<
=ndo
=k+1;
=n-s;
=s+6*k
writeln(k)
输出:
1000
第13题(7分)
array[1..14]oflongint
=(94,32,40,90,99,80,46,21,69,28,64,73,85,54);
i,j,k,m,left,right,temp:
=8;
=1;
=14;
whileleft<
rightdo
=a[m];
=left;
j:
=right;
whilek<
a[j]doj:
=j-1;
whilek>
a[i]doi:
ifi<
=jthen
temp:
=a[j];
a[j]:
=temp;
=j-1
untili>
j;
ifj<
mthenleft:
ifi>
mthenright:
=j
writeln(a[m])
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- pascal 习题 阅读程序 阅读 程序
![提示](https://static.bdocx.com/images/bang_tan.gif)