上一页 1 ··· 262 263 264 265 266 267 268 269 270 ··· 367 下一页
摘要: 1、 #include <stdio.h> #include <string.h> typedef struct{ char name[128]; double height; double weight; }Type1; void swap2(Type1 *x, Type1 *y) { Type1 阅读全文
posted @ 2021-06-07 19:01 小鲨鱼2018 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> typedef struct{ char name[128]; double height; double weight; }Type1; void swap(Type1 *x, Type1 *y) { Type1 tmp = *x; *x = *y; * 阅读全文
posted @ 2021-06-07 18:44 小鲨鱼2018 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> typedef struct{ char name[128]; double height; double weight; }Typex; void swap(Typex *x, Typex *y) { Typex tmp = *x; *x = *y; * 阅读全文
posted @ 2021-06-07 16:25 小鲨鱼2018 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define NUMBER 5 void sort(int x[], int n) { int i, j; // i表示具体循环的轮数, j表示每一轮参与比较的元素的下标 for(i = 0; i < n - 1; i++)//一共循环的轮数n - 1, 阅读全文
posted @ 2021-06-07 09:57 小鲨鱼2018 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; int lines = 0; double c1, c2, c3; double c1sum = 0, c2sum = 0, c3sum = 0; if((fp = fopen("a.txt","r") 阅读全文
posted @ 2021-06-06 22:34 小鲨鱼2018 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; //打开文件前必须要定义FILE*型指针变量 int lines = 0; char name[128]; double height, weight; double hsum = 0, wsum = 阅读全文
posted @ 2021-06-06 22:17 小鲨鱼2018 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; // 打开文件前,必须定义FILE*型指针变量 char file[128]; printf("please input the file: "); scanf("%s", file); fp = fo 阅读全文
posted @ 2021-06-06 20:50 小鲨鱼2018 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; // 打开文件前,必须定义FILE*型指针变量。 char file[128]; printf("please input the filename: "); scanf("%s", file); // 阅读全文
posted @ 2021-06-06 20:35 小鲨鱼2018 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; //打开文件时,必须要提前在函数中定义FILE*型指针变量, 然后将fopen函数返回的FILE型指针对象赋值给定义的指针变量,就可以通过该变量来修改文件了 fp = fopen("a.txt","r" 阅读全文
posted @ 2021-06-06 20:28 小鲨鱼2018 阅读(592) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; char filename[128]; printf("filename: "); scanf("%s", filename); fp = fopen(filename, "r"); if(fp != 阅读全文
posted @ 2021-06-06 09:44 小鲨鱼2018 阅读(47) 评论(0) 推荐(0) 编辑
上一页 1 ··· 262 263 264 265 266 267 268 269 270 ··· 367 下一页