皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
题目:主函数 main()中由数字和字母组成的字符串s为测试数据,程序 主要提取字符串 s中由字符'$'分隔的不同八进制数形式的字符串, 将八进制数形式字符子串所对应的字符生成新的字符串 t;然后 统计字符串 t中所有数字子串对应整数的出现频率。 例如:字符串 s为"101$062$063$114$066$110$062$063$141$071",处理 后字符串 t为"A23L6H23a9",其中"23"对应整数23出现频率为2, "6"和"9"对应整数出现频率为1。 编写程序: 1. 编写函数void GenStr(char s[],char t[]),计算字符串s中不同 八进制数形式的字符子串,将每个八进制数形式字符子串所对应 的字符保存在字符数组 t中。 2. 编写函数int CountFreq(char t[],int b[],int Freq[]),统计 字符数组 t中不同数字子串对应整数出现频率,不同整数保存在 整数数组 b中,出现频率保存在整数数组Freq中,函数返回整数个 数。 ************************************************************** 注意:请勿改动主程序 main()中的任何语句。 *************************************************************/ #include #include #include #include #include #define N 10 void GenStr(char s[],char t[]) { /**********Program**********/ /********** End **********/ } int CountFreq(char t[],int b[],int Freq[]) { /**********Program**********/ /********** End **********/ } int main() { char s[]="101$062$063$114$066$110$062$063$141$071"; char t[N]=""; int b[N]={0},Freq[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=CountFreq(t,b,Freq); printf("The different integer and frequency is: "); fprintf(fp,"The different integer and frequency is: "); for(i=0;i
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【简答题】CSS属性:设置左边框样式
【单选题】While it may be unlikely for a computer to write a best seller, a technology expert has created a computer program that writes its own fiction stories with minimal user input. The program, called MEXI...
A.
It is a computer program that can write fiction stories on its own.
B.
It is a computer program created by Rafael Pérezy Pérez.
C.
It is blamed for low quality among many other descriptors.
D.
The stories it has written is not very popular among readers.
【单选题】The seller may breach the contract by the followings except ( ).
A.
nonperformance
B.
deferred performance
C.
delivery on time
D.
nonconformity of the goods
【单选题】阅读下面的文 言 文,完成 1--7题 辛公义陇西狄道人也公义早孤为母氏所养亲授 书传 周天和中选良家子任太学生以勤苦称 武帝时,召入露门学 1 ,令受道义。每月集御前令与大儒讲论,数被嗟异,时辈慕之。从军平陈,以功除岷州刺史。土俗畏病,若一人有 疾 ,即合家避之,父子夫妻不相看养,孝义道绝,由是病者多死。公义患之,欲变其俗。因分遣官人巡检部内,凡有 疾 病,皆以床舆 来 ,安置 厅事 2 。暑月...
A.
书传,指书籍与传记,也指有关《 尚书 》经义解释的书籍,后指一般的著作典籍。
B.
厅事, 古作 “ 听事 ”,指 官署视事问案的厅堂 ,后 私家 住宅的堂屋 也 可 称此名。
C.
使君,初指奉天子之命、出使四方的使者; 汉时用以 称刺 史,后为州郡长官的尊称。
D.
D .乡闾, 古以二十五家为闾,一万二千五百家为乡,用以 指人烟繁盛的通都大邑 。
【多选题】以下著作中属于“二十四史”中“前四史”的是( )。
A.
《汉书》
B.
《后汉书》
C.
《三国志》
D.
《晋书》
【单选题】The seller may be________ of the consuming chain.
A.
at the beginning
B.
in the middle
C.
at the end
D.
either A or B
【单选题】The consignee of goods under the B/L may be one of the following parties, which is the best choice for seller ( )
A.
to the buyer of the sales contract
B.
to the named consignee including straight consignee or order of consignee without endorsement and transferor
C.
to the bearer
D.
to the order of the seller
【单选题】The seller may breach the contract by_______.( )
A.
nonperformance
B.
deferred performance
C.
nonconformity of goods
D.
All above
【多选题】A seller may breach a contract when ( )
A.
he fails to deliver the goods
B.
he delivers the goods that do not conform to the contract
C.
he fails to make payment
D.
he presents the documents that are incomplete
【多选题】以下著作中属于“二十四史”中“前四史”的是 ( )
A.
《史记》
B.
《汉书》
C.
《三国志》
D.
《晋书》
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题