皮皮学,免费搜题
登录
搜题
【简答题】
编程题: 主函数 main()中由数字与字母组成的字符串s为测试数据,程序 首先从字符串 s尾部开始,按逆序把在其中出现的每相邻的两个字 符,紧随其后重复出现一次,若字符串 s中头部有剩余的单个字 重复,生成新的字符串 t;然后计算字符串t中数字子串对应 整数的各位数字之和。 例如 : 当s="A48CD06",则字符串t为"6060DCDC8484AA",其数字子串对 应整数的各位数字之和为 12和24。 编写程序: 1. 编写函数void GenStr(char s[],char t[]),按上述规则生成 字符串,结果保存在字符数组 t中。 2. 编写函数int Calculate(char t[],int b[]),计算字符串t中各 个数字子串对应整数的各位数字之和,结果保存在整数数组 b中, 函数返回整数个数。 ************************************************************** 注意:请勿改动主程序 main()中的任何语句。 *************************************************************/ #include #include #include #include #include #define N 80 void GenStr(char s[],char t[]) { /**********Program**********/ /********** End **********/ } int Calculate(char t[],int b[]) { /**********Program**********/ /********** End **********/ } int main() { char s[]="A48CD06"; char t[N]; int b[N]={0}; int num=0,i=0; FILE *fp; if((fp=fopen("DATA.TXT","w"))==NULL) { printf("File open error\n"); exit(0); } GenStr(s,t); printf("The string t is: %s\n",t); fprintf(fp,"The string t is: %s\n",t); num= Calculate(t,b); printf("Sum of the digits of each integer is: "); fprintf(fp,"Sum of the digits of each integer is: "); for(i=0;i
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】下面哪个部件可以进行编辑修改工作?
A.
存储部件
B.
工作部件
C.
显示部件
D.
以上部件都可以
【单选题】下面哪个部件可以进行编辑修改工作?
A.
存储部件
B.
显示部件
C.
工作部件
D.
以上部件都可以
【简答题】驱动桥通过主减速器( )改变转矩的传递方向。
【单选题】下列各项中,影响资源性资产评估价值相对的重要因素是( )。
A.
资源的本质
B.
资源的性质
C.
资源的区位
D.
资源的品牌
【单选题】Which of the following statements is true?
A.
The wide influence of conservatism can be found in American daily life.
B.
Few English people atrach great importance to local and individual character.
C.
English people are known for their conservatism.
D.
English people like small talk and usually espress their mind freely.
【判断题】驱动桥通过主减速器齿轮副来改变发动机转矩的传递方向
A.
正确
B.
错误
【单选题】多盘浓缩机的滤液有什么特点?
A.
浊滤液
B.
清滤液
C.
既有浊滤液、也有清滤液
D.
没有浊滤液,也没有清滤液
【多选题】驱动桥的作用:
A.
通过主减速器齿轮的传动,降低转速,增大转矩;
B.
主减速器采用锥齿轮传动,改变转矩的传递方向;
C.
通过差速器可以使内外侧车轮以不同转速转动,适应汽车的转向要求;
D.
通过桥壳和车轮,实现承载及传力作用。
【简答题】C2B电商模式是以( )为中心。
【单选题】Which of the following statements is true?
A.
The wide influence of conservatism can be found in American daily life.
B.
Few English people attach great importance to local and individual character.
C.
English people are known for their conservatism.
D.
English people like small talk and usually espress their mind freely.
相关题目: