- 1、本文档共38页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
计算机二级C语言题库之程序编写(国外英文资料)
计算机二级C语言题库之程序编写(国外英文资料)
Third, programming
To find a minimal positive integer, is 3, 5, 7, 9 except the remainder respectively the number 1, 3, 5, 7, the format of % d written to the examinee folder Paper a folder under the new file Design1. Dat.
# include stdio, h
H # include math.h
Void main ()
{
/ * candidates add code here
The FILE * p; Int I;
P = fopen ( Design1. Dat , w);
For (I = 1; +)
If (I % = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Fprintf (p, % d, I);
The fclose (p);
}
If a and b are equal to 1, the factor of a and the factor of b and b are equal to a, and a is not equal to b. For example: 220, 284 is 1 pair of intimate number, 284, 220 is also 1 pair of intimate number. Within 6 ~ 5000 to find out all the close pairs, and each pair of close several language sentence fprintf (p, % % 6 d, 6 d \ n, a, b) is written to the examinee folder Paper a folder under the new file Design2. Dat.
# include stdio, h
Void main ()
{the FILE * p; Int a, b, c, k;
P = fopen ( design. Dat , w);
/ * candidates add code here
For (k = 6; k = 5000; k+ +)
{b = 0; C = 0;
For (a = 1; a k; a + +)
If (k % a = = 0) b + = a;
For (a = 1; a b; a + +)
If b % a is equal to 0, c + = a;
If (k = = c).
}
The fclose (p);
}
Design program: calculate the weight of each character in the string s, which is the product of the position value of the character in the string with the ASCII value of the character. The position value is increasing from 1. The weight value of each character is written in the format % d to the new file desig.dat in the source directory under the Paper subdirectory.
# include stdio, h
H # include math.h
Void main ()
{FILE * p; Int I, w;
Char * s = we45 * y3r # $1;
/ * candidates add code here
P = fopen ( design. Dat , w);
For (I = 0;)
{w = (I + 1) * s [I];
Fprintf (p, % d, w);
}
The fclose (p);
}
Divide each row of the array a by the most significant element
文档评论(0)