摘要: #include<stdio.h> #include<stdlib.h> int main() { FILE *fp; char ch; fp=fopen("file1.dat","rb"); while(!feof(fp)) { ch=fgetc(fp); putchar(ch); } fclos 阅读全文
posted @ 2019-12-29 14:18 任12123 阅读(137) 评论(2) 推荐(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-24 09:39 任12123 阅读(116) 评论(2) 推荐(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-16 23:42 任12123 阅读(121) 评论(2) 推荐(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 14:07 任12123 阅读(119) 评论(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 = nu 阅读全文
posted @ 2019-11-18 22:20 任12123 阅读(72) 评论(2) 推荐(0)
摘要: line11 line14改变了数据的宽度 line12 line13 line15改变了数据的精度 EX2 line13 a1 a2 a3前缺少地址符& line17 18应使用%lf 如图为正确代码 %lf表示双精度整数类型,%ld表示输出长整型,比如 %5d指宽度为5的整型,%lf指长整数的浮 阅读全文
posted @ 2019-11-03 17:19 任12123 阅读(169) 评论(3) 推荐(0)
摘要: #include int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); int y; y==x%2; if(y==1) printf("是奇数"); else printf("是偶数... 阅读全文
posted @ 2019-10-16 20:29 任12123 阅读(134) 评论(0) 推荐(0)