随笔分类 - c/c++
摘要:从文件编码的方式来看,文件可分为ASCII码(或unicode)文件和二进制码文件两种。 文本文件是基于字符编码的文件。 二进制文件是基于值编码的文件。 二进制编码的字符(ascii或unicode等)表示文件内容, 是文本文件, 其中包含文本字符内容。 二进制值代表机器语言代码或数值数据、图片、音
        阅读全文
                
摘要:1、 #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { srand((unsigned int) time(0)); int i; for(i = 0; i < 10; i++) { printf("%
        阅读全文
                
摘要:1、 #include <stdio.h> void critic(int * ar1); int main(void) { int num; printf("how many pounds to a firkin of butter? \n"); scanf("%d", &num); while(
        阅读全文
                
摘要:1、 #include <stdio.h> #define SIZE 100 void get_n(char * ar, int n); int main(void) { int n; printf("n = "); scanf("%d", &n); while(getchar() != '\n')
        阅读全文
                
摘要:9、 #include <stdio.h> char *s_gets(char *st, int n); int main(void) { char st1[100]; s_gets(st1, 100); puts(st1); return 0; } char *s_gets(char *st, i
        阅读全文
                
摘要:1、 #include <stdio.h> #define MONTHS 12 #define YEARS 5 int main(void) { const float rain[YEARS][MONTHS] = { {4.3, 4.3, 4.3, 3.0, 2.0, 1.2, 0.2, 0.2, 
        阅读全文
                
摘要:复习题 9 #include <stdio.h> void show_menu(void); int getchoice(int low, int high); int main(void) { int res; show_menu(); while((res = getchoice(1,4)) !
        阅读全文
                
摘要:1、 #include <stdio.h> #include <stdlib.h> int main(void) { int ch; FILE * fp; char filename[128]; int lines; char tail; printf("please input the filen
        阅读全文
                
摘要:1、 #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <stdbool.h> int main(void) { int ch; char filename[128]; FILE * fp; bool word = 
        阅读全文
                
摘要:1、 #include <stdio.h> #include <ctype.h> #include <stdbool.h> int main(void) { char ch; bool word = false; bool space = false; int words = 0; while((c
        阅读全文
                
摘要:1、 #include <stdio.h> #include <stdlib.h> int main(void) { int ch; FILE * fp; char filename[128]; int sum = 0; printf("please input filename: "); scan
        阅读全文
                
摘要:1、 #include <stdio.h> int main(void) { char choice; printf("a) xxxx b) yyyy\n"); printf("c) zzzz q) quit.\n"); printf("input your choice: "); while((c
        阅读全文
                
摘要:1、 #include <stdio.h> #include <stdbool.h> long get_long(void); long square_sum(long num1, long num2); bool get_range(long start, long end, long lower
        阅读全文
                
摘要:#include <stdio.h> long get_long(void); int main(void) { long num; printf("please input an num: "); num = get_long(); printf("num: %ld.\n", num); retu
        阅读全文
                
摘要:#include <stdio.h> int main(void) { long num; printf("please input an positive num: "); while(1) { while(scanf("%ld", &num) != 1) { printf("please inp
        阅读全文
                
摘要:测试程序1: #include <stdio.h> int main(void) { char ch; printf("please input an character: \n"); while((ch = getchar()) != '#') printf("xxx\n"); return 0;
        阅读全文
                
摘要:c语言中使用程序读取文件。 #include <stdio.h> #include <stdlib.h> int main() { int ch; FILE * fp; char fname[50]; printf("enter the name of the file: "); scanf("%s
        阅读全文
                
摘要:1、 #include <stdio.h> #include <ctype.h> int main(void) { char ch; int n_space = 0, n_lines = 0, n_other = 0; while((ch = getchar()) != '#') { if(ch =
        阅读全文
                
摘要:1、 #include <stdio.h> #include <ctype.h> #include <stdbool.h> #define STOP '|' int main(void) { char ch; char prep; long n_ch = 0L; int n_lines = 0; i
        阅读全文
                
摘要:1、 #include <stdio.h> #define STOP '|' int main(void) { char ch; int chnum = 0; int lines = 0; while((ch = getchar()) != STOP) { if(ch != '\n') chnum+
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号