摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; 阅读全文
posted @ 2020-01-01 07:02 ztabcd 阅读(80) 评论(0) 推荐(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-25 07:35 ztabcd 阅读(98) 评论(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:45 ztabcd 阅读(126) 评论(3) 推荐(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-01 12:12 ztabcd 阅读(92) 评论(2) 推荐(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 = num 阅读全文
posted @ 2019-11-19 08:47 ztabcd 阅读(93) 评论(3) 推荐(0)
摘要: #include<stdio.h> int main(){ double x,y; char c1,c2,c3; int a1,a2,a3; scanf("%d%d%d",&a1,&a2,&a3); printf("%d,%d,%d\n",a1,a2,a3); scanf("%c%c%c",&c1,&c2,&c3); printf("%c%c%c\n",c1,c2,c3); scanf("%lf, 阅读全文
posted @ 2019-11-06 06:59 ztabcd 阅读(125) 评论(3) 推荐(0)
摘要: /*判断奇偶数*/ #include<stdio.h> int main() { int x; printf("输入一个整数"); scanf("%d",&x); if(x%2!=0) printf("是奇数"); else printf("是偶数"); return 0; } /*提示休息日*/ 阅读全文
posted @ 2019-10-22 09:27 ztabcd 阅读(96) 评论(0) 推荐(0)