摘要: 对n个整数数进行冒泡排序 步骤: 首先需要一个整形数组来存放整数,然后输入n个数到数组中去 然后对数组中的值两两比较,把最大(小)的放到最后去 #include <stdio.h> #define MAX 100 void Sort(int arr[], int len); //排序函数原形 voi 阅读全文
posted @ 2023-03-18 09:18 codels 阅读(259) 评论(0) 推荐(0)
摘要: 四页玫瑰数:一个四位数的每一位的四次方加起来等于这个数本身的数 #include <stdio.h> #include <math.h> //包含pow()函数 int main(void) { int i, j; for (i = 1000; i < 10000; i++) //数的范围是所有四位 阅读全文
posted @ 2023-03-18 08:57 codels 阅读(50) 评论(0) 推荐(0)