摘要: 2020 输入30个数存入数组a,求出数的每个位数的平方和存入数组b,从小到大排列后输出 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int Squares(int n){ //求平方和 5 int sum = 0, i; 6 for (i=1; i 阅读全文
posted @ 2020-12-10 21:22 郑NINE 阅读(896) 评论(3) 推荐(0) 编辑
摘要: 2019 50个[100,300]的随机数,要求用二分法查找从键盘录入的关键数字。找到回复位置,找不到回复不存在 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 5 void sort(int arr[]) 6 { 7 阅读全文
posted @ 2020-12-10 21:16 郑NINE 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 2018 产生20个随机数,在[200,400]内,其中能被5整除的存入数组array2,要求输出array2中的平均值 #include <stdio.h> #include <stdlib.h> #include <time.h> int main(){ srand((unsigned)time 阅读全文
posted @ 2020-12-10 21:14 郑NINE 阅读(734) 评论(2) 推荐(0) 编辑