皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
【程序设计】 --------------------------------------------------------- 题目:主函数 main()中字符串s为测试数据,字符串s由若干形如 "$1,234"的货币格式的子串组成,首先将s中所有的货币格 式的子串转换成整数,存入数组 a中,然后将数组a中每个 整数转换成八进制数字字符串存入二维字符数组 oct中。 例如:字符串 s为 "$1,234$21,456$3,968$11,759", 转换后存入数组 a中的整数为 1234 21456 3968 11759 , 每个整数转换成八进制数字字符串,存入数组 oct的各行字 "2322" "51720" "7600" "26757"。 编写程序: 1、编写int abstract(char s[],int a[])函数,按上述规 则将字符串 s中的子串转换成整数,存入数组a中,函数 返回整数个数。 2、编写void convert(int a[],char oct[][N],int m)函 数 , 将数组a中每个整数转换成八进制数字字符串形式, 并存入二维字符数组 oct中。 --------------------------------------------------------- 注意:请勿改动主函数 main()中的任何语句。 -------------------------------------------------------*/ #include #include #include #include #include #define M 50 #define N 50 int abstract(char s[],int a[]) { /**********Program**********/ /********** End **********/ } void convert(int a[],char oct[][N],int m) { /**********Program**********/ /********** End **********/ } void main(){ char s[M]="$1,234$21,456$3,968$11,759"; int a[M]; char oct[M][N]; int i,n; FILE *fp; if((fp=fopen("data.txt","w"))==NULL) { printf("File open error\n"); exit(0); } n=abstract(s,a); fprintf(fp,"Following are integers:\n"); printf("Following are integers:\n"); for(i=0;i
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】在某高校本科生中随机抽20个学生,设其中有X个是女生,Y个是男生,则X,Y的相关系数为( )
A.
-1
B.
1
C.
0
D.
0.5
【多选题】Please point out( ) are the characteristics of settlement by letters of credit.
A.
L/C is a self- sufficient instrument
B.
L/C is a document transaction
C.
L/C is not a self- sufficient instrument
D.
L/C is a cargo transaction
【简答题】某城市桥梁工程的钻孔灌注桩成孔方法采用正循环回转钻理,在钻孔的过程中产生了钻孔偏斜,施工人员采取了补救措施后,才使得钻孔顺利进行。 该施工单位档案管理人员对施工全过程中形成的施工技术文件进行了组卷,卷内的文件排列顺序依次是:封面、目录、文件材料和备考表。 档案管理人员编排的文件资料有:施工试验资料;竣工测量资料;测量复核及预验记录;使用功能试验记录;施工报告;施工图设计文件会审与技术交底记...
【单选题】下列哪个选项不属于民族自治地方,不享有宪法和有关法律规定的自治权?(    )
A.
自治      
B.
自治州
C.
自治县    
D.
民族乡
【单选题】Please point out which of the following expressions is not the characteristics of settlement by letters of credit.( )
A.
L/C is a self-sufficient instrument
B.
L/C is a document transaction
C.
The issuing bank’ s liabilities for payment
D.
L/C is a cargo transaction
【简答题】Please point out( )are the characteristics of settlement by letter of credit.
【单选题】下列哪个选项不属于民族自治地方,不享有宪法和有关法律规定的自治权?
A.
自治区
B.
自治州
C.
自治县
D.
民族乡
【简答题】Please point out one: or two artistic features of the poem with the examples in the text.
【单选题】程序功能检验方法文件是
A.
GAT 757-2006
B.
GAT 757-2007
C.
GAT 757-2008
D.
GAT 757-2009
【单选题】Please point_____ the mistakes I have made.
A.
at
B.
for
C.
with
D.
out
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题