摘要:
c语言中程序的循环控制,do语句。 1、do语句用户输入决定执行判断奇偶数程序的次数 #include <stdio.h> int main(void) { int j; do { int i; puts("please input an integer."); printf("i = "); sc 阅读全文
摘要:
c语言中的二重循环。 1、输出九九乘法表 #include <stdio.h> int main(void) { int i, j; for (i = 1; i <= 9; i++) { for (j = 1; j <= 9; j++) { printf("%4d", i * j); } putch 阅读全文
摘要:
创建一个函数,将和有n个元素的数组中的key相等的所有元素的下标存储在另一个数组中,并返回和key元素相同的元素的个数。 1、数组元素的查找 #include <stdio.h> #define NUMBER 10 int func1(const int x[], int y[], int z, i 阅读全文
摘要:
创建一个函数,将和有n个元素的数组中的key相等的所有元素的下标存储在另一个数组中,并返回和key元素相同的元素的个数。 1、数组元素的查找 #include <stdio.h> #define NUMBER 10 int func1(const int x[], int y[], int z, i 阅读全文
摘要:
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 阅读全文