早教吧作业答案频道 -->其他-->
谁知道这个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该怎...的网友还看了以下:
谁知道这个program该怎么写?THX!WriteaCprogramtoimplementasi 2020-04-13 …
关于量子力学的用角动量量子化J=n*(hbar)推rn和En的过程中:圆轨道给出mv^2/r=e^ 2020-05-15 …
怎样使用matlab解下面的代数方程?急.syms a b c d e;2*b^2=a^2+c^2 2020-05-16 …
limx->0(e^x+e^2+e^3)/3lim(x~0)((e^x+e^2x+e^3x)/3) 2020-05-17 …
E^2*R/(R+r)^2=E^2/(R-r)^2/R+4r(某公式推导最后两行)本人只得:=E^ 2020-06-07 …
e^x1-e^x2+1/ex^1-1/e^x2怎么等于(e^x2-e^x1)(1/e^x1e^2- 2020-06-12 …
关于参数方程的问题1.x=e^t+e^(-t)y=2(e^t-e^(-t))e=2.71828(t 2020-08-02 …
EXCEL计算k3=1/1+e(2+2.23c3+3d3+2.4e3)这个怎么算k3=1/1+e(2 2020-10-31 …
maple不等方程组solve({-(-u^3/3-e*u^2/2+u)>-(e^2+4)^(3/2 2020-10-31 …
用C++求不超过30000E数列的最大E数的值/*数列:E(1)=E(2)=1E(n)=(n-1)* 2020-11-20 …