摘要: #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-29 16:55 柏闰杰 阅读(110) 评论(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-22 14:52 柏闰杰 阅读(112) 评论(1) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 int main() { int a[N]={2,7,19,45,66}; int i, 阅读全文
posted @ 2019-12-17 22:42 柏闰杰 阅读(138) 评论(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-03 20:46 柏闰杰 阅读(113) 评论(3) 推荐(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-20 23:22 柏闰杰 阅读(134) 评论(2) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> int main(){ printf("输入分数(0~100):"); int a; scanf("%d",&a); if(a<0||a>100) {printf("输入数据错误\n"); exit(0); } switch( 阅读全文
posted @ 2019-11-05 21:54 柏闰杰 阅读(124) 评论(2) 推荐(0)
摘要: 代码打得比较慢,封号容易漏 阅读全文
posted @ 2019-10-20 17:10 柏闰杰 阅读(63) 评论(0) 推荐(0)
摘要: #include int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); if(x%2==1) printf("是奇数"); else printf("是偶数"); ... 阅读全文
posted @ 2019-10-20 17:08 柏闰杰 阅读(76) 评论(0) 推荐(0)