皮皮学,免费搜题
登录
搜题
【简答题】
已知数据文件IN72.DAT中存有200个4位数,并已调用读函数readDat()把这些数存入数组a中,请编制一函数jsVal(),其功能是:把个位数字和千位数字重新组合成一个新的十位数ab(新十位数的十位数字是原4位数的个位数字,新十位数的个位数字是原4位数的千位数字),以及把百位数字和十位数字组成另一个新的十位数cd(新十位数的十位数字是原4位数的百位数字,新十位数的个位数字是原4位数的十位数字),如果新组成的两个数均为偶数且两个十位数中至少有一个数能被9整除,同时两个新十位数字均不为零,则将满足此条件的4位数按从大到小的顺序存入数组b中,并计算满足上述条件的4位数的个数cnt,最后调用.写函数writeDat()把结果cnt及数组b中符合条件的4位数输出到OUT72.DAT文件中。 注意:部分源程序已给出。 已定义数组:a[200], b[200],已定义变量:cnt。 请勿改动主函数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('IN72. DAT', 'r'); for(i=0; i<NAX; i++) fscanf(fp, '%d', &a[i]]; fclose(fp); } main() { int i; readDat(); jsVal() for(i=0; i<cnt; i++) printf('%d/n', b[i]); prIntf('/n'); wrlteDat(); } wrlteDat() { FILE *fp; int i; fp=fopen('OUT72.DAT', 'w'); fprlrltf(fp, '%d/n', cnt); for(i=0;i<Cht; i++ fprIntf(fp, '%d/n',h[i]); fclose(fp); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】会计工作交接时,接替人员在交接时因疏忽没有发现所接会计资料的真实性、完整性方面的问题,如事后发现,则该问题应由( )负责。
A.
会计机构负责人
B.
接替人员
C.
原移交人员负责
D.
接替人员和原移交人员共同负责
【单选题】What does the woman want to learn?
A.
She wants to send some information to her friend.
B.
She wants to get some information about the computer.
C.
She wants to learn how to use the computer.
【判断题】( )房内放有两张单人床的套间称为“标准间”。
A.
正确
B.
错误
【简答题】R28. Suppose Alice and Bob are sending packets to each other over a computer network. Suppose Trudy positions herself in the network so that she can capture all the packets sent by Alice and send what...
【简答题】单例模式通过线程____来控制资源的并发访问。
【简答题】会计工作交接时,接替人员在交接时因疏忽没有发现所接会计资料的真实性、完整性方面的问题,如事后发现,则该问题应由( )负责。
【简答题】会计工作交接时,接替人员在交接时因疏忽没有发现所接会计资料的真实性、完整性方面存在的问题,如事后发现,则该问题应由( )负责。
【简答题】Mrs. Black lives on Second Avenue. New Year is coming. She wants to send (寄) a card to her friend in Toronto, but she doesn’t know where the post office is. She asks her neighbor (邻居) Mary, “ Is there...
【简答题】She wants to send a p________(包裹) t her friend.
【简答题】默认情况下,Linux系统提供tty1~()的终端界面。
相关题目: