随笔分类 - c/c++
摘要:1、 #include <stdio.h> int main(void) { FILE *fp; double a[10] = {1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,0.1}; int i; for(i = 0; i < 10; i++) { printf("a[
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { FILE *fp; // 定义指向FILE型的指针变量 double pi = 3.14159265358979323846; printf("Pi from value: %23.21f.\n", pi); // 直接输
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { FILE *fp; // 声明指向FILE型的指针变量 double pi = 3.14159265358979323846; //声明 double型变量 printf("pi from value: %23.21f.\
        阅读全文
                
摘要:1、 #include <stdio.h> #include <ctype.h> int main(void) { int ch; FILE *sfp; FILE *dfp; char sfile[FILENAME_MAX]; char dfile[FILENAME_MAX]; printf("sf
        阅读全文
                
摘要:1、 #include <stdio.h> #include <ctype.h> int main(void) { int ch; FILE *sfp; FILE *dfp; char sfile[FILENAME_MAX]; char dfile[FILENAME_MAX]; printf("sf
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { int ch; FILE *sfp; FILE *dfp; char sfile[FILENAME_MAX]; char dfile[FILENAME_MAX]; printf("sfile name: "); scanf
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("filename: "); scanf("%s", filename); if((fp = fopen(file
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("please input filename: "); scanf("%s", filename); if((fp
        阅读全文
                
摘要:c语言中显示文件内容。 1、 #include <stdio.h> int main(void) { FILE *fp; // 定义FILE型的指针变量,用于接收fopen函数返回的流指针 int ch; // 声明字符,注意是int char filename[FILENAME_MAX]; // 
        阅读全文
                
摘要:1、 #include <stdio.h> #include <time.h> char filename[] = "timedata.dat"; void put_dat(void) { FILE *fp; if((fp = fopen(filename, "r")) == NULL) print
        阅读全文
                
摘要:1、 #include <stdio.h> #include <time.h> char file[] = "datatime.dat"; void put_data(void) { FILE *fp; if((fp = fopen(file,"r")) == NULL) // 未检测到datati
        阅读全文
                
摘要:c语言中写入日期和时间。 1、 #include <stdio.h> #include <time.h> int main(void) { FILE *fp; time_t current = time(NULL); struct tm *timer = localtime(¤t); i
        阅读全文
                
摘要:1、 #include <stdio.h> #include <time.h> // time_t数据类型,日历时间头文件 int main(void) { time_t current = time(NULL); // 利用time函数获取日历时间(返回1970之后的秒数,整型) struct t
        阅读全文
                
摘要:1、 #include <stdio.h> #define NUMBER 6 typedef struct{ char name[128]; double height; double weight; }Type1; int main(void) { FILE *fp; fp = fopen("xx
        阅读全文
                
摘要:1、 #include <stdio.h> #include <string.h> typedef struct{ char name[128]; double height; double weight; }Type1; void swap2(Type1 *x, Type1 *y) { Type1
        阅读全文
                
摘要: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; *
        阅读全文
                
摘要: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; *
        阅读全文
                
摘要: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,
        阅读全文
                
摘要: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")
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { FILE *fp; //打开文件前必须要定义FILE*型指针变量 int lines = 0; char name[128]; double height, weight; double hsum = 0, wsum = 
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号