分析:根据题意分析得出:本题主要考查考生的字符串指针或字符串数组以及根据公式进字符的ASCII值运算,再根据运算结果和条件进行相应的替代操作,要求考生仅编写函数encryptChar()实现转换功能。其中输入及输出函数给出且已调用,考生不必自己编写。
编写函数encryptChar()的程序内容如下:
void encryptChar()
{ int i, j, val ;
for(i=0 ; i
for(j=0 ; j
val=(xx[i][j]*11) % 256 ;
if(! (val<=32 || val>130)) xx[i][j]=val ;
}
}
数据文件IN.DAT内容如下:
You may WANT A FIELD in field in each record to uniquely identify that1234
record from all other records IN THE FILE. For example, the Employee123456
Number field is unique if you DO NOT ASSIGN the same number to two12345678
different employees, and you never reassign THESE NUMBERS to other12345678
employees. If you wish to FIND OR MODIFY the record belonging to a11111111
specific employee, this unique FIELD SAVES the thouble of determining22222
whether you have the correct record.12345678901234567
If you do not have a unique field, YOU MUST FIND THE first record123456787
the matches your key and determine whether THEN RECORD is the one you33333
want. If it is not the CORRECT ONE, you must search again to find others.4
结果文件OUT.DAT内容如下:
Youm+3WAZTAF#EDDinbiWlLinW+AxrWAorLtouniquWl3iLWntib3tx+t1&1<rWAorLbrom+llotxWrrWAorLs#ZTHEF#DE.ForW(+mplW,txWEmplo3WW1&1