摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; 阅读全文
posted @ 2019-12-31 18:52 磨叽Mogic 阅读(103) 评论(1) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; 阅读全文
posted @ 2019-12-23 22:01 磨叽Mogic 阅读(111) 评论(1) 推荐(0)
摘要: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i 阅读全文
posted @ 2019-12-17 22:38 磨叽Mogic 阅读(95) 评论(1) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,int m,int bb[N]) { int i,j,k=0,flag; for(j=n;j<=m;j++) { flag=1; for(i=2;i<j;i++) 阅读全文
posted @ 2019-12-03 22:19 磨叽Mogic 阅读(103) 评论(1) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf("输入第%d个数: ", n); scanf("%d", &number); max = number; min = nu 阅读全文
posted @ 2019-11-18 23:08 磨叽Mogic 阅读(114) 评论(1) 推荐(0)
摘要: /* C语言程序设计教程学习指导》p119 实验内容(2) 这是一个格式化输入输出函数及格式符使用练习找出两处错误,修改并运行程序 为a1,a2,a3,c1,c2,c3,x,y输入数据,使得:a1=1,a2=2,a3=3,c1='a',c2='b',c3='c', x=1.5, y=2.5 */ # 阅读全文
posted @ 2019-11-02 18:14 磨叽Mogic 阅读(142) 评论(1) 推荐(0)
摘要: // 程序功能: // 要求用户从键盘输入一个整数,判断其是奇数还是偶数 #include int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); // 在×××处填写相应表达式 // 使得当表达式成立时,判定x是奇数,否则是偶... 阅读全文
posted @ 2019-10-23 10:53 磨叽Mogic 阅读(140) 评论(0) 推荐(0)