分析:根据题意分析得出:本题主要考查考生的字符串指针或字符串数组以及根据公式进字符的ASCII值运算,再根据运算结果和条件进行相应的替代操作,要求考生仅编写函数encryptChar()实现转换功能。其中输入及输出函数给出且已调用,考生不必自己编写。 编写函数encryptChar()的程序内容如下:# |8 [. H# L6 i3 u/ P
void encryptChar()2 x5 x6 t9 o" i+ q4 S+ {! `/ D
{ int i, j, val ;# Q/ g; M. C/ Z$ o! r
for(i=0 ; i
, ?1 [! C' Q0 M S! v2 p- D9 Z/ ? for(j=0 ; j
. }! k2 T- q4 ?) [ val=(xx[j]*11) % 256 ;
2 w! B! W5 b* D+ S# W1 a if(! (val130)) xx[j]=val ;( R/ e, P4 \# K! M; C2 m: F8 _: }
}
* z- r2 {% N4 c2 t }
9 H |; y1 e) I% g- O' ]8 Q) l 数据文件IN.DAT内容如下:. v; }2 t' } `3 t* Z% Z
You may WANT A FIELD in field in each record to uniquely identify that1234$ a6 N3 G: K1 Q6 _0 D
record from all other records IN THE FILE. For example, the Employee1234560 C2 O! [1 z6 n }8 o
Number field is unique if you DO NOT ASSIGN the same number to two12345678: ?/ _# d2 H7 g) S
different employees, and you never reassign THESE NUMBERS to other12345678" \1 p8 L P" v5 d! { z
employees. If you wish to FIND OR MODIFY the record belonging to a11111111+ j! m q3 y/ P7 i( @
specific employee, this unique FIELD SAVES the thouble of determining22222" F/ Z$ j7 L7 X/ s0 o4 B- F
whether you have the correct record.123456789012345670 b2 y# [/ T3 h8 e
If you do not have a unique field, YOU MUST FIND THE first record123456787
1 a5 G! x. Z( P- R1 n4 y V! R the matches your key and determine whether THEN RECORD is the one you33333
i! ^4 \: t: \$ g want. If it is not the CORRECT ONE, you must search again to find others.4 |