摘要:
c语言中数组元素的线性查找。 1、再数组中查找特定的元素,并返回查找的索引。 #include <stdio.h> #define NUMBER 7 #define FAILED -1 int func1(const int x[], int y, int z) { int i = 0; while 阅读全文
摘要:
创建一个函数,对元素个数为n的int型数组进行倒序排列,并将结果保存到另一个数组中。 1、 #include <stdio.h> #define NUMBER 9 void func1(int x[], const int y[], int z) { int i; for (i = 0; i < z 阅读全文
摘要:
创建一个函数,对元素个数为n的int型数组进行倒序排列 1、 #include <stdio.h> #define NUMBER 9 void func1(int x[], int y) { int i; for (i = 0; i < y / 2; i++) { int tmp = x[i]; x 阅读全文
摘要:
1、创建一个函数,返回元素个数为n的int型数组中的最小值 #include <stdio.h> #define NUMBER 7 int func1(const int x[], int y) { int i, min = x[0]; for (i = 0; i < y; i++) { if (x 阅读全文
摘要:
c语言, 函数中数组的传递,形参和实参。 1、 #include <stdio.h> #define NUMBER 5 int func1(int x[], int y) ##函数中传递数组的形参 { int i, max = x[0]; for (i = 0; i < y; i++) { if ( 阅读全文
摘要:
c语言中编写函数求五个学生中的最高分。 1、 #include <stdio.h> #define NUMBER 5 int v[NUMBER]; int func1(void) { int i, max = v[0]; for (i = 0; i < NUMBER; i++) { if (v[i] 阅读全文
摘要:
1、c语言中没有形参的函数 #include <stdio.h> int func1(void) ## 没有形参的函数 { int i; puts("please input an integer."); do { printf("i = "); scanf("%d", &i); if (i <= 阅读全文