皮皮学,免费搜题
登录
搜题
【简答题】
题目:主函数main()中由一组正整数组成的一维数组a为测试数据, 首先找出出现次数最多的整数,若不同整数有相同的最多 出现次数时,选择最早出现的整数。再判断此整数是否为阿 姆斯特朗数。 阿姆斯特朗数是指,一个正整数等于其各位数字的立方和。 编写程序: 1、编写 int maxt(int a[],int n)函数,按上述规则找出 数组a中出现次数最多的正整数,函数返回此数。 2、编写 int amst(int m)函数,判断参数m是否为阿姆斯特 朗数,是阿姆斯特朗数函数返回1,否则函数返回0。 --------------------------------------------------------- 注意:请勿改动主函数main()中的任何语句。 -------------------------------------------------------*/ #include #include #include #include #include #define N 10 int maxt(int a[],int n) { /**********Program**********/ /********** End **********/ } int amst(int m) { /**********Program**********/ /********** End **********/ } void main() { int a[N]={370,612,153,267,153,153,267,407,407,371}; int m; FILE *fp; if((fp=fopen("data.txt","w"))==NULL) { printf("File open error\n"); exit(0); } m=maxt(a,N); if(amst(m)) { fprintf(fp,"%d is an Armstrong number.\n",m); printf("%d is an Armstrong number.\n",m); } else { fprintf(fp,"%d is not an Armstrong number.\n",m); printf("%d is not an Armstrong number.\n",m); } fclose(fp); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】The word 'causes' in paragraph 1, line 6 of the email is closest in meaning to
A.
reasons
B.
effects
C.
conditions
D.
missions
【单选题】71 There are hard causes of conflict (e.g. conflicting schedules) and soft causes. Soft causes are as important as hard causes. Soft causes include diversity of disciplinary expertise, _____, and the ...
A.
Performance tradeoffs
B.
Ambiguity of roles
C.
Administrative procedures
D.
Determining earned value
【单选题】膀胱肿瘤最常见的组织学类型是
A.
鳞状细胞癌
B.
间质细胞肿瘤
C.
移行细胞肿瘤
D.
腺癌
E.
横纹肌肉瘤
【单选题】下列关于万方数据跨库高级检索,说法错误的是( )
A.
提供期刊论文、学位论文、会议论文等资源限定选择
B.
提供各学科的分类目录限定检索
C.
支持布尔逻辑运算符
D.
提供模糊匹配
【判断题】E arning revenue causes owners ’ equity to decrease .
A.
正确
B.
错误
【简答题】一、实验任务及结果 1. 创建一个名为 player 的文件,在当前文件中输入以下信息并保存,注意其格式为单列多行。 Messi Messi cluo neimaer mubapei Messi yuandaiyuan 查看文件内容,输出: 1) 各相邻重复行的重复次数 ; 2) 相邻重复行 3) 不相邻重复行 4) 删除文件 player 中所有重复行 2. 创建名为 fruit 和 peopl...
【多选题】安全经费支出中“软”技术方面包括()
A.
安全管理
B.
安全奖励
C.
宣传与教育
D.
工业卫生
【单选题】膀胱肿瘤最常见的组织学类型()。
A.
乳头状细胞癌
B.
透明细胞癌
C.
嫌色细胞癌
D.
移行细胞癌
E.
鳞状细胞癌
【单选题】These causes produced the great change in the country that modernized the______of higher education from the mid-1860s to the mid-1880s.
A.
branch
B.
category
C.
domain
D.
scope
【单选题】膀胱肿瘤最常见的组织学类型是
A.
乳头状细胞癌
B.
透明细胞癌
C.
嫌色细胞癌
D.
移行细胞癌
E.
鳞状细胞癌
相关题目: