摘要: strcpy 要求传入的两个指针 restrict(即区间不重叠)。 因此直接 strcpy(&a[1],a) 是未定义行为。 阅读全文
posted @ 2023-12-24 20:51 Kazuma_124 阅读(23) 评论(0) 推荐(0)
摘要: void test() { FILE* fp = fopen("test.txt", "w"); if (fp == NULL) { perror("fopen error"); exit(1); } char a[5] = { '1','2','\0','3','4' }; fwrite(a, s 阅读全文
posted @ 2023-12-24 20:07 Kazuma_124 阅读(41) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { //printf()函数不同参数间可以换行 printf("num one : %d,num two : %d", 1, 2); //printf字符串内换行的三种方法 //一 printf("Here's one way to pri 阅读全文
posted @ 2023-12-24 14:05 Kazuma_124 阅读(915) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int i = 3; for (i; i; i--) { printf("%d\n", i); } //3\n2\n1\n for (int i = 0; 1; i++) { if (!(i - 10)) { break; } prin 阅读全文
posted @ 2023-12-23 13:18 Kazuma_124 阅读(19) 评论(0) 推荐(0)
摘要: 学生成绩管理系统 页面效果如图: 代码如下: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> //行和列常量 #define ROW 20 #define COL 83 typedef stru 阅读全文
posted @ 2023-12-21 20:32 Kazuma_124 阅读(71) 评论(0) 推荐(0)
摘要: #include <stdio.h> #define AAA 111 void test() { printf("__LINE__ = % d\n", __LINE__); printf("AAA = %d\n", AAA); } #define AAA 222 #line 1 "test" int 阅读全文
posted @ 2023-12-21 19:45 Kazuma_124 阅读(23) 评论(0) 推荐(0)
摘要: char a[] = "hello%d\n%dworld"; printf(a, 2, 3); //输出: //hello2 //2world 事情的起因是使用printf("\033[0;47;30m");改变命令行字体背景和颜色的时候,室友提起能否让用户改变字体颜色。因为那需要改变printf( 阅读全文
posted @ 2023-12-11 17:15 Kazuma_124 阅读(44) 评论(0) 推荐(0)
摘要: \(\lim_{x \to 0} \frac{\sqrt[n]{1+x} -1}{\frac{x}{n} } =1\)的证明 \[\lim_{x \to 0} \frac{\sqrt[n]{1+x} -1}{\frac{x}{n} } =\lim_{x \to 0} \frac{\left ( 1+ 阅读全文
posted @ 2023-11-12 11:48 Kazuma_124 阅读(1317) 评论(0) 推荐(0)
摘要: 1到50列表,阶乘之和 S=1!+2!+3!+⋯+n!(n≤50) 1::1 2::3 3::9 4::33 5::153 6::873 7::5913 8::46233 9::409113 10::4037913 11::43954713 12::522956313 13::6749977113 阅读全文
posted @ 2023-11-02 17:00 Kazuma_124 阅读(821) 评论(0) 推荐(0)
摘要: printf("%8d", i);可以输出整数 i,让它占至少 8 个字符的宽度(即场宽为8):如果 i 不够8 位则在左边补空格使它右对齐满 8 位,如果 i 的输出的位数 ≥ 8,则输出整个 i 。printf("%08d",i);则表示如果i不够8位则在左边补0 同理,printf("%8s" 阅读全文
posted @ 2023-09-21 14:59 Kazuma_124 阅读(1971) 评论(0) 推荐(1)