皮皮学,免费搜题
登录
搜题
【简答题】
已知数据文件in38.dat中存有200个4位数,并已调用读函数readDat()把这些数存入数组a中,请编制一函数jsVal(),其功能是:若一个4位数的千位数字上的值小于等于百位数字上的值,百位数字上的值小于等于十位数字上的值,以及十位数字上的值小于等于个位数字上的值,并且此4位数是偶数,则统计出满足此条件的数的个数cnt并把这些4位数按从小到大的顺序存入数组b中,最后调用写函数writeDat()把结果cnt及数组b中符合条件韵4位数输出到out38.dat文件中。 注意:部分源程序已给出。 已定义数组;a[200],b[200],已定义变量:ent。 请勿改动主函数main()、读函数readDat()和写函数writeDat()的内容。 试题程序: include<stdio.h> define MAX 200 int a[MAX],b[MAX],cnt=0; void jsVal() { void readDat( { int i; FILE *fp; fp=fopen('in38.dat','r'); for(i=0;i<MAX;i++) fscanf(fp,'%d',&a[i]); fclose(fp); } void main ( ) { int i; readDat ( ); j sVal ( ); printf ( '满足条件的数=%d/n', cnt ); for (i=0; i<cnt; i++) printf('%d/n',b[i] ); writeDat ( ); } writeDat ( ) { FILE *fp; int i; fp= fopen ( 'out 3 8. dar' , 'w' ); fprintf (fp, '%d/n', cnt); for (i=0; i<cnt; i++) fprint f (fp, '%d/n' ,b[i] ); fclose (fp); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】The phrase 'put yourself in their shoes' in paragraph 4 is closest in meaning to
A.
dress yourself like them
B.
do as they ask you to
C.
think as they would
D.
put on their shoes
【简答题】把零件的加工过程划分加工阶段的原因有哪些?
【简答题】把零件的加工过程划分加工阶段的原因有哪些?
【简答题】把零件的加工过程划分加工阶段的原因有哪些?
【简答题】把零件的加工过程划分加工阶段的原因有哪些?
【单选题】The phrase 'put yourself in their shoes' in Paragraph 3 is closest in meaning to__________. 查看材料
A.
dress yourself like them
B.
do as they ask you to
C.
put on their shoes
D.
think as they would
【单选题】“根据本章各条规定要求采取避免碰撞的任何行动,如当时环境许可,应是积极地并应及早地进行......”,该款规定(第8条第1款)适用于__。1对遇局面中的两艘机动船;2互见中的让路船,不适用于直航船;3能见度不良中两艘不在互见中构成碰撞危险的在航船舶。
A.
B.
②③
C.
①②
D.
①②③
【单选题】In the last paragraph, the phrase 'put up with' would most probably mean ______.
A.
to tolerate
B.
to oppose
C.
to take an advantage
D.
to disagree with
【简答题】The phrase “keep a lid on”(Line 6, Paragraph 3) most probably means_____. [A] put an end to [B] set a limit on [C] tighten the control over [D] reduce the speed of
【简答题】把零件的加工过程划分加工阶段的原因有哪些?
相关题目: