早教吧作业答案频道 -->其他-->
谁知道这个program该怎么写?THX!WriteaCprogramtoimplementasimplechecksumfunctionforasinglelineofinput(i.e.,endswith'n').Thechecksumisdonebymultiplyingtheasciicodeofeachinputcharacterwithdigit1,2,3,...,9,1,2,3,.
题目详情
谁知道这个program该怎么写?THX!
Write a C program to implement a simple check sum function for a single line
of input (i.e.,ends with 'n').The check sum is done by multiplying the ascii code of each input characterwith digit 1,2,3,...,9,1,2,3,...and sum up the result.The \x0cnal total is the\check sum" we are looking for.For example,for the input line "This is a sample input line of text",its
check sum is calculated by
T h i s i s a s a m p ...
1 2 3 4 5 6 7 8 9 1 2 3 4 5 ...
Then the check sum is
84x1+104x2+105x3+115x4+32x5+105x6+115x7+32x8+97x9+32x1+115x2+97x3+109x4+:::
Your program should find and display the check sum of the input text.
Write a C program to implement a simple check sum function for a single line
of input (i.e.,ends with 'n').The check sum is done by multiplying the ascii code of each input characterwith digit 1,2,3,...,9,1,2,3,...and sum up the result.The \x0cnal total is the\check sum" we are looking for.For example,for the input line "This is a sample input line of text",its
check sum is calculated by
T h i s i s a s a m p ...
1 2 3 4 5 6 7 8 9 1 2 3 4 5 ...
Then the check sum is
84x1+104x2+105x3+115x4+32x5+105x6+115x7+32x8+97x9+32x1+115x2+97x3+109x4+:::
Your program should find and display the check sum of the input text.
▼优质解答
答案和解析
nt i; for(i = 2; i < m/2; i++) { if(0 == m%i) { printf("%d x ", i); get(m/i); return; } } printf("%d \n...
看了 谁知道这个program该怎...的网友还看了以下:
已知圆o:x^2y^2=4和点M(1,a).若a=3,求过点M作圆O的切线的切线长已知圆o:x^2 2020-04-27 …
已知方程(x^2/25-m)(y^2/9-m)=1,m的值在什么范围内,方程表示椭圆?双曲线? 2020-05-12 …
sos!分式的加减(1)1/m2-4+1/m+2+1/2-m(2)x2-y2/x+y÷(2-x2+ 2020-06-02 …
(2912•浦东新区二模)如八所示,高为9.gm二水平通道内,有一个与之等高二质量为M=1.2kg 2020-06-29 …
1.(m+1)2-9(m-1)2注数字或字母的上方的2是平方,3是3的平方2.(x-1)(x-3) 2020-07-19 …
1:已知关于X的方程X方+2x-m+1=O没有实根.判别方程x方-mx+2m-1=0的根的情况2: 2020-08-01 …
[惊人发现]1=O.9循环1=O.9循环∵1/3=O.3循环∴1/3+1/3=O.3循环+O.3循环 2020-10-31 …
已知直线y=9(m-1)x+1-3m当为何值时直线1.经过原点?2.与y轴相交于点(0,2)?3.与 2020-11-01 …
第一道:已知(25^m)=2000,(80^n=2000),试求(1/m)+(1/n)的值.(要有步 2020-12-17 …
(m+2)^2-9(m-1)^2(x-y)(x^2+xy+y^2)-xy(y-x)3(x-1)^2- 2021-01-04 …