摘要: // 从stdin获取字符串,输出到文件中 #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { FILE *file = fopen("test.txt", "w"); if (NULL == file) 阅读全文
posted @ 2023-05-09 15:59 jason8826 阅读(33) 评论(0) 推荐(0) 编辑
摘要: // 文件拷贝 #include <stdio.h> int main(int argc, char *argv[]) { FILE *file_A = fopen("A.txt", "r"); if (NULL == file_A) { printf("fopen file_A error\n") 阅读全文
posted @ 2023-05-09 00:57 jason8826 阅读(22) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int my_strnum(const char *str1, const char *str2) { int num = 0, str1_len = 0, str2_len = 0; const char *temp1 = str1; const char * 阅读全文
posted @ 2023-05-06 13:34 jason8826 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 计算字符串 str 的长度,直到空结束字符,但不包括空结束字符 size_t strlen(const char *str) { size_t len = 0; while (*str++ != '\0') { len++; } return len; } 把 str1 所指向的字符串和 str2 阅读全文
posted @ 2023-05-05 18:13 jason8826 阅读(42) 评论(0) 推荐(0) 编辑
摘要: clock_t这是一个适合存储处理器时间的类型。time_t这是一个适合存储日历时间的类型。struct tm这是一个用来保存时间和日期的结构。tm 结构的定义如下: struct tm { int tm_sec; /* 秒,范围从 0 到 59 */ int tm_min; /* 分,范围从 0 阅读全文
posted @ 2023-05-05 00:45 jason8826 阅读(16) 评论(0) 推荐(0) 编辑
摘要: rand() 函数产生的随机数是伪随机数,是根据一个数值按照某个公式推算出来的,这个数值a56爆大奖在线娱乐们称之为“种子”。种子在每次启动计算机时是随机的,但是一旦计算机启动以后它就不再变化了;也就是说,每次启动计算机以后,种子就是定值了,a56爆大奖在线娱乐根据公式推算出来的结果(也就是生成的随机数)就是固定的。 生成随机数,需 阅读全文
posted @ 2023-05-03 11:49 jason8826 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 字符数组初始化 char a[] = "linux"; char a[] = {'l', 'i', 'n', 'u', 'x', '\0'}; 以上两种方式等价,定义数组a,占6字节,右值"linux"只存在于编译器中,编译器将它用来初始化字符数组a后丢弃掉(也就是说内存中是没有"linux"这个字 阅读全文
posted @ 2023-04-28 17:06 jason8826 阅读(61) 评论(0) 推荐(0) 编辑
摘要: int main(int argc, char *argv[]) { char num[20] = {0}; int temp = 0; printf("请输入一个8进制数:"); gets(num); int i = 0; while (num[i] != '\0') { temp = temp* 阅读全文
posted @ 2023-04-26 14:18 jason8826 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 转:python:excel文件转csv_python_风铃扬音-DevPress官方社区 (csdn.net) 阅读全文
posted @ 2023-04-24 01:34 jason8826 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- import sys import os import subprocess import xml.dom.minidom as xmldom def parse_xml(): lj='Output\Report\d 阅读全文
posted @ 2023-04-23 22:48 jason8826 阅读(0) 评论(0) 推荐(0) 编辑