上一页 1 ··· 303 304 305 306 307 308 309 310 311 ··· 407 下一页
摘要: 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 阅读(660) 评论(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 阅读(355) 评论(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 阅读(48) 评论(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 阅读(42) 评论(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 阅读(695) 评论(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 阅读(54) 评论(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:26 小鲨鱼2018 阅读(49) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <math.h> #define sqr(x) ((x) * (x)) typedef struct{ double x; double y; }Point; typedef struct{ Point pt; double fuel; 阅读全文
posted @ 2021-06-05 21:32 小鲨鱼2018 阅读(83) 评论(0) 推荐(0)
摘要: c语言中用结构体表示点的坐标,并计算两点之间的距离 1、 #include <stdio.h> #include <math.h> #define sqr(x) ((x) * (x)) typedef struct{ double x; double y; }Point; double dist(P 阅读全文
posted @ 2021-06-05 17:07 小鲨鱼2018 阅读(1849) 评论(0) 推荐(0)
摘要: 1、 1.1 #include <stdio.h> #include <string.h> #define NUMBER 5 #define NAME_LEN 64 typedef struct{ char name[NAME_LEN]; int height; float weight; long 阅读全文
posted @ 2021-06-05 16:11 小鲨鱼2018 阅读(48) 评论(0) 推荐(0)
上一页 1 ··· 303 304 305 306 307 308 309 310 311 ··· 407 下一页