已知数据文件IN31.DAT中存有200个4位数,并已调用读函数readDat()把这些数存人数组a中,请编制一函数jsVal(),其功能是:把千位数字和十位数字重新组合成一个新的2位数ab(新2位数的十位数字是原4位数的千位数字,新2位数的个位数字是原4位数的十位数字),以及把个位数字和百位数字组成另一个新的2位数cd(新2位数的十位数字是原4位数的个位数字,新2位数的个位数字是原4位数的百位数字),如果新组成的两个2位数ab>cd,ab必须是偶数且能被5整除,cd必须是奇数,同时两个新2位数的十位数字均不为0,则将满足此条件的4位数按从大到小的顺序存人数组b中,并要计算满足上述条件的4位数的个数cnt,最后调用写函数writeDat()把结果ent及数组b中符合条件的4位数输出到OUT31.DAT文件中。 注意:部分源程序已给出。 程序中已定义数组:a[200],b[200],已定义变量:cnt。 请勿改动主函数main()、读函数readDat()和写函数writeDat()的内容。 [试题程序] #include<stdio.h> #define MAX 200 int a[MAx],b[MAX],cnt=0; voidwriteDat(); void jsVal() void readDat() int i; FILE*fp; fp=fopen("IN31.DAT","r"); for(i=0;i<MAX;i++) fscanf(fp,"%d",&a[i]); fclose(fp); void main() int i; readDat(); jsVal(); printf("满足条件的数=%d\n",cnt); for(i=0;i<cnt;i++) printf("%d",b[i]); printf("\n"); writeDat(); void writeDat() FILE*fp; int i; fp=fopen("OUT31.DAT","w"); fprintf(fP,"%d\n",cnt); for(i=0;i<cnt;i++) fprintf(fp,"%d\n",b[i]); fclose(fP);
查看答案
A —telegraphic transfer B —bill of loading C —prepaid D —demand draft E —special drawing rights F —shipping order G —packing list H —mail transfer I —port of loading J —port of destination K —ocean freight L —letter of credit M —customs N —delivery order O —destination delivery charge P —delivered duty paid Examples: (L) 信用证 (M) 关税 51. ( ) 目的港 ( ) 装货指示书 52. ( ) 电汇 ( ) 海运费 53. ( ) 装箱单 ( ) 信汇 54. ( ) 到港通知 ( ) 完税后交货 55. ( ) 提单 ( ) 票汇
依次填入下列各句括号内的词语,恰当的一组是( )。 (1)他跟着大队跑近前线,炮声越来越响了,清脆的枪声也渐渐地清楚了,淡淡的白烟也( )了,心头反而一步步平静下来…… (2)我离开仙台之后,就多年没有照过相,又因为状况也无聊,说起来无非使他失望,便连信也怕敢写了。经过的年月一多,话更无从说起,所以虽然有时想写信,却又( )下笔。 (3)好风景固然可以打动人心,但若得几个情投意合的人,相与( )其间,那才真有味儿;这时候风景觉得更好。
A. 看见 难以 徘徊
B. 望见 难以 徜徉
C. 望见 不能 徜徉
D. 看见 不能 徘徊
There are three kinds of goals: short-range, medium-range and long-range goals. Short-range goals are what usually deal with current activities, which we can apply on a daily basis. Such goals can be achieved in a week or less. or two weeks, or possible months. It should be remembered that just as a building is no stronger than its foundation, our long-term goals cannot amount to very much without the achievement of solid short-term goals. Upon completing our short-term goals, we should date the occasion and then add new short-range goals that will build on those that have been completed. The intermediate goals build on the foundation of the short-range goals. They might deal with just one term of school or the entire school year, or they could even extend for several years. Any time you move a step at a time, you should never allow yourself to become discouraged or over-whelmed. As you complete each step, you will enforce the belief in your ability to grow and succeed. And as your list of completion dates grows, your motivation and desire will increase. Long-range goals may be related to our dreams of the future. They might cover five years or more; Life is not a static thing. We should never allow a long-term goal to limit us or our course of action. Goals Variety of goals: short range, medium range and long-range goals The foundation of the medium-range and long-range goals are (46) Steps to achieve your final goal: 1. complete our short-term goals 2. date the occasion and then (47) goals to the (48) goals 3. make intermediate goals 4. increase (49) , by realizing our intermediate goal 5. realize long-range goals Features of long-range goals: 1. maybe related to our (50) 2. might cover five years or more
If he fails his exams, ________________(那只能怪他自己) .