随笔分类 - C/C++
C/C++ code 学习之路
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 struct date 6 { 7 int _year; 8 int _month; 9 in
阅读全文
摘要:1 void Avg(int score[][5], int n) 2 { 3 double sum = 0; 4 for (int i = 0; i < 4; i++) 5 { 6 sum += *(*(score + i) + 0); 7 } 8 printf("第一门课程的平均分:%f\n",
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <math.h> 5 6 //穷举法--效率不高 7 int gcd(int a, int b) 8 { 9 int g
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 int main() 5 { 6 int array[100]; 7 //向array数组中填充1~100所有数据 8 for (int
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <math.h> 5 #include <string.h> 6 7 int main() 8 { 9 int n =
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 int d = 1; 5 void fun(int p) 6 { 7 int d = 5; 8 d += p++; 9 printf("%
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 void fun(int *s, int n1, int n2) 5 { 6 int i, j, t; 7 i = n1; 8 j = n
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <ctype.h> 5 #include <string.h> 6 void fun(char *p) 7 { 8 in
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { char p[20] = { 'a', 'b', '
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdlib.h> 3 #include <stdio.h> 4 #include <string.h> 5 int main() 6 { 7 int t = 0; 8 while (printf("*"
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 int main() 5 { 6 int i, v1 = 0, v2 = 0, v3 = 0; 7 for (i = 5; i < 15;
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <string.h> 4 #include <stdlib.h> 5 6 7 int main() 8 { 9 unsigned char a = 0x5b, b
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <math.h> 5 #include <string.h> 6 7 8 //存款利息的计算 9 int main()
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <math.h> 5 6 int main() 7 { 8 printf("%s\n", "hello world");
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <stddef.h> 5 #include <errno.h> 6 7 struct S 8 { 9 int n; 10
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 char *getmemory(void) 7 { 8 char p[] = "hello
阅读全文
摘要:动态内存分配: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 #include <errno.h> 6 #include <Windows.
阅读全文
摘要:1 枚举类型 2 enum sex 3 { 4 //枚举的可能取值 - 常量s 5 male = 2,//给枚举常量赋初值ss 6 female = 4, 7 secret = 8 8 }; 9 10 enum color 11 { 12 red, 13 green, 14 blue,s 15 };
阅读全文
摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 #include <assert.h> 6 #include <stddef.h> 7 8 9
阅读全文

浙公网安备 33010602011771号