全球旧事资料 分类
ij0flag0breakr
r
r
r
ifflag0pri
tfquotYES
quotr
r
elsepri
tfquotNO
quotr
r
r
r
r
r
70025程序填空,不要改变与输入输出有关的语句。输入一个正整数repeat0ltrepeatlt10,做repeat次下列运算:输入日期年、月、日,输出它是该年的第几天。要求定义与调用函数day_of_yearyearmo
thday,计算并返回year年、mo
th月和day日对应的是该年的第几天,函数形参year、mo
th和day的类型是i
t,函数类型也是i
t。输入输出示例:括号内为说明输入:2repeat21981311981年3月1日2000312000年3月1日输出:daysofyear601981年3月1日是该年的第60天daysofyear612000年3月1日是该年的第61天i
cludequotstdiohquoti
tmai
voidi
tdayday_yearmo
thyeari
trepeatrii
tday_of_yeari
tyeari
tmo
thi
tdayscar
upquot中没有大写辅音字母r
r
r
r
r
r
r
r
i
cludequotstdiohquotr
r
defi
eMAXLEN80r
r
i
tmai
voidr
r
r
r
charchr
r
charstrMAXLENr
r
i
tcou
tir
r
i
trepeatrir
r
r
r
sca
fquotdquotamprepeatr
r
getcharr
r
forri1riltrepeatrir
r
i0r
r
whilechgetchar39
39r
r
strichr
r
r
r
stri0r
r
r
r
cou
t0i0r
r
whilestri39039r
r
ifstrigt39A39ampampstrilt39Z39r
r
ifstri39A39ampampstri39E39ampampstri39I39ampampstri39O39ampampstri39U39r
r
cou
tr
r
ir
r
r
r
r
r
pri
tfquotcou
td
quotcou
tr
r
r
r
r
r
70034程序填空,不要改变与输入输出有关的语句。输入一个正整数repeat0ltrepeatlt10,做repeat次下列运算:r
r
输入一个以回车结束的字符串(少于80个字符),将其中的大写字母用下面列出的对应大写字母替换,其余字符不变,输出替换后的字符串。r
r
原字母对应字母r
r
AZr
r
BYr
r
CXr
r
DWr
r
……r
r
XCr
r
YBr
r
ZAr
r
输入输出示例:括号内为说明r
r
输入:r
r
2repeat2r
r
AflagofUSAr
r
123r
r
输出:r
r
AfterreplacedZflagofFHZr
r
Afterreplaced123r
r
r
r
r
r
r
r
i
cludequotstdiohquotr
r
i
cludequotstri
ghquotr
r
defi
eMAXLEN80r
r
i
tmai
voidr
r
r
r
charchr
r
charstrMAXLENr
r
i
tir
r
i
trepeatrir
r
r
r
sca
fquotdquotamprepeatr
r
getcharr
r
forri1riltrepeatrir
r
i0r
r
whilechgetchar39
39r
r
strichr
r
ir
r
r
r
stri0r
r
r
r
i0r
r
whilestri39039r
r
ifstrigt’A’ampampstrilt’Z’r
r
stri’Z’stri‘A’r
r
ir
r
r
r
r
r
pri
tfquotAfterreplacedquotr
r
fori0stri0r
好听全球资料 返回顶部