早教吧作业答案频道 -->其他-->
谁知道这个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该怎...的网友还看了以下:
九宫格对角线数独*3*5*4*8*7***9***2***3*6***1*9***2*3*5*** 2020-04-27 …
大家帮我这些题对么计算(-1)^100×5+(-2)^4÷4=1×5+16÷4=5+4=97/6× 2020-07-13 …
1、2,5,28,257,()A.2006B.1342C.3503D.31262、0,9,5,29 2020-07-18 …
2、3、9、6算24要3种方法有:(9-2-3)*6=243*9-(6/2)=24(26)*(9/ 2020-07-19 …
quadndg求多重积分的计算速度问题我有一个求9重积分问题,积分区间从一个数积到无穷,函数具体形 2020-07-23 …
计算(1)2.5+7.5÷5(2)12.6+4.5÷3-12.7(3)9999×2222+3333 2020-07-24 …
计算(1)2.5+7.5÷5(2)12.6+4.5÷3-12.7(3)9999×2222+3333 2020-07-24 …
数列(1/4+9),(1/2+9/2),(3/4+3),(1+9/4),(5/4+9/5),…中,数 2020-11-06 …
VB中数据转换麻烦指导下VB代码该如何写:TXT文件中包含:直选复式4,5,7,9|2,3,6|1, 2020-12-05 …
在()填上大于小于或等于。①2/3÷9()9②2/3×3()2/9÷2③5÷3()5×1/3在()填 2021-02-05 …