随笔分类 -  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 阅读全文
posted @ 2022-03-24 21:55 小团熙 阅读(32) 评论(0) 推荐(0)
摘要: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", 阅读全文
posted @ 2022-03-23 22:18 小团熙 阅读(35) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-22 23:02 小团熙 阅读(88) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-21 22:03 小团熙 阅读(55) 评论(0) 推荐(0)
摘要: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 = 阅读全文
posted @ 2022-03-20 22:29 小团熙 阅读(41) 评论(0) 推荐(0)
摘要: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("% 阅读全文
posted @ 2022-03-19 22:18 小团熙 阅读(56) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-18 22:02 小团熙 阅读(18) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-17 22:53 小团熙 阅读(58) 评论(0) 推荐(0)
摘要:#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', ' 阅读全文
posted @ 2022-03-16 22:42 小团熙 阅读(40) 评论(0) 推荐(0)
摘要: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("*" 阅读全文
posted @ 2022-03-15 21:16 小团熙 阅读(61) 评论(0) 推荐(0)
摘要: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; 阅读全文
posted @ 2022-03-14 21:18 小团熙 阅读(122) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-14 15:20 小团熙 阅读(55) 评论(0) 推荐(0)
摘要: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() 阅读全文
posted @ 2022-03-12 21:22 小团熙 阅读(38) 评论(0) 推荐(0)
摘要: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"); 阅读全文
posted @ 2022-03-11 23:16 小团熙 阅读(31) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-10 22:34 小团熙 阅读(40) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-09 22:32 小团熙 阅读(47) 评论(0) 推荐(0)
摘要:动态内存分配: 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. 阅读全文
posted @ 2022-03-08 21:35 小团熙 阅读(32) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2022-03-08 15:17 小团熙 阅读(0) 评论(0) 推荐(0)
摘要: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 }; 阅读全文
posted @ 2022-03-08 15:13 小团熙 阅读(38) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-03-07 20:44 小团熙 阅读(53) 评论(0) 推荐(0)