皮皮学,免费搜题
登录
搜题
【简答题】
已知数据文件1N56.DAT中存有200个4位数,并已调用读函数readDat()把这些数存入数组a中,请编制一函数isVal(),其功能是:把千位数字和十位数字重新组合成一个新的十位数(新十位数的十位数字是原4位数的千位数字,新十位数的个位数字是原4位数的十位数字),以及把个位数和百位数组成另一个新的十位数(新十位数的十位数字是原4位数的个位数字,新个位数的个位数字是原4位数的百位数字),如果新组成的两个十位数均为素数且新十位数字均不为零,则将满足此条件的4位数按从大到小的顺序存入数组b中,并要计算满足亡述条件的4位数的个数cnt,最后调用写函数writeDat()把结果cnt及数组b中符合条件的4位数输出到OUT56.DAT文件中。 注意:部分源程序己给出。 已定义数组:a[200],b[200],己定义变量:cnt。 请勿改动主函数main()、读函数readDat()和写函数writeDat()的内容。 试题程序: include<stdio . h> define MAX 200 int a[MAX] ,b[MAX] ,cnt=0; int isprime(int m) { int i; for (i=2; i<=m/2 ;i++) if(re%i==0) return 0; return 1; } void jsVal() { } void readDat ( ) { int i; FILE rfp; fp= fopen (' IN56. DAT', 'r' ); for (i=0; i<MAX; i++) fscanf (fp, '%d', &a [i] ); fclose (fp); } main ( ) { int i; readDat (); jsVal (); printf ('满足条件的数=%d/n', cnt); for (i=0; i<cnt; i++) printf ('%d/n', b [i] ; printf ('kn''); writeDat (); } writeDat () { FILE *fp; int i; fp=fopen ('OUT56. DAT', 'w'); fprintf (fp, '%d/n', cnt); for (i=0; i<cnt; i++) fprintf(fp, '%dkn',b[i]); fclose (fp); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【多选题】根据我国《中央企业综合绩效评价实施细则》的规定,纳入评价企业经营增长状况的修正指标有( )。
A.
资本积累率
B.
销售利润率
C.
技术投入比率
D.
总资产增长率
E.
不良资产比率
【多选题】Which of the following costs can be included in the total cost of construting an asset by a company for its own use?
A.
Dismantling and removing cost
B.
Ongoing maintenance charges for asset.
C.
Porportion of administrative overheads
D.
Interest on capital borrowed to finance production of the asset.
E.
Directly attributable labour costs.
【多选题】根据《企业效绩评价操作细则(修订)》的规定,下列指标中,属于评价企业效绩基本指标的有( )。
A.
市盈率
B.
资本积累率
C.
已获利息倍数
D.
净资产收益率
E.
流动资产周转率
【判断题】人力资源战略管理的实质,就是要在人力资源管理与组织战略规划之间建立起内在联系,明确人力资源管理在战略形成和战略实施的不同阶段上所扮演的角色、所承担的职责及所发挥的作用。
A.
正确
B.
错误
【多选题】Based on a deal on CFR terms, the total cost of the export factors include ( ).
A.
purchasing cost
B.
other domestic expenses
C.
abroad freight
D.
insurance premium
【单选题】对资源的___实质上就是对资源的管理
A.
用和管理
B.
用和配置
C.
理和配置
D.
理和调节
【单选题】对资源的( )实质上就是对资源的管理。
A.
应用和管理
B.
应用和配置
C.
整理和配置
D.
整理和调节
【单选题】物业管理绩效评价中,( )是企业当年所有者权益总的增长率,反映了企业所有者权益在当年的变动水平。
A.
营业增长率
B.
资产负债率
C.
流动资产周转率
D.
资本积累率
【单选题】_____ is believed that the better­known companies spend about 70 per cent of the total cost of the product itself on packaging!
A.
This
B.
One
C.
That
D.
It
【单选题】Based on a deal on FOB term, the total cost of the export factors include the followings EXCEPT ( )
A.
purchasing cost
B.
domestic expenses
C.
export duties
D.
import duties and taxes
相关题目: