zzy-c

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

03 2022 档案

摘要://数组名是什么 //数组名是首元素的地址 //但是有两个例外 //1.sizeof(数组名)-数组名表示整个数组-计算的整个数组的大小单位是字节 //2.&数组名-数组名表示整个数组-取出的是整个数组的地址 // #define _CRT_SECURE_NO_WARNINGS 1 #include 阅读全文
posted @ 2022-03-31 11:05 zzy_C 阅读(158) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<string.h> void bubble_sort(int arr[],int sz) { //计算数组元素个数 //确定趟数 int i = 0; for (i = 0; i 阅读全文
posted @ 2022-03-31 10:51 zzy_C 阅读(31) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<string.h> int main() { int arr[3][4] = { {1,2,3,4},{5,6,7,8},{9,10,11,12} }; int i = 0; i 阅读全文
posted @ 2022-03-31 09:14 zzy_C 阅读(44) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> //编写一个函数实现n的k次方,使用递归实现。 int Pow(int n, int k) { if (k == 0) return 1; if (k > 0) return n * Pow(n, 阅读全文
posted @ 2022-03-30 15:38 zzy_C 阅读(193) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> //计算一个数的每位之和(递归实现) int DigitSum(int n) { if(n>9) { return DigitSum(n / 10) + n % 10; } else { retu 阅读全文
posted @ 2022-03-30 14:19 zzy_C 阅读(84) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h>//字符串逆序 int my_strlen(char* str) { int count = 0; while (*str != '\0') { count++; str++; } return c 阅读全文
posted @ 2022-03-29 21:56 zzy_C 阅读(75) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> void print_table (int n) { int i = 0; for (i = 1; i <= n; i++) { //打印一行 int j = 0; for (j = 1; j < 阅读全文
posted @ 2022-03-29 17:27 zzy_C 阅读(70) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h>//采用递归求n的阶乘 int count = 0; //递归可以求解 但是效率太低 int Fib(int n) { //统计第三个斐波那契数的计算机次数 if (n == 3) count++; 阅读全文
posted @ 2022-03-29 16:11 zzy_C 阅读(57) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h>//采用递归求n的阶乘 int Fac(int n) { if (n <= 1) return 1; else return n * Fac(n - 1); } int main() { int n 阅读全文
posted @ 2022-03-29 15:42 zzy_C 阅读(179) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int my_strlen(char* str) { if (*str != '\0') return 1 + my_strlen(str + 1); else return 0; } int m 阅读全文
posted @ 2022-03-29 15:04 zzy_C 阅读(53) 评论(0) 推荐(0)

摘要: 阅读全文
posted @ 2022-03-29 14:42 zzy_C 阅读(88) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int Fun (int n) { if (n == 5) return 2; else return 2 * Fun(n + 1); } int main() { printf("%d\n", 阅读全文
posted @ 2022-03-29 14:37 zzy_C 阅读(739) 评论(0) 推荐(0)

摘要:#pragma comment(lib,"sub.lib") 阅读全文
posted @ 2022-03-29 11:51 zzy_C 阅读(50) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<string.h> int main() { //printf函数返回的是打印在屏幕上字符的个数 printf("%d", printf("%d", printf("%d", 4 阅读全文
posted @ 2022-03-28 21:53 zzy_C 阅读(134) 评论(0) 推荐(0)

摘要://#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int binary_search(int a[], int k, int s) { int left = 0; int right = s - 1; whi 阅读全文
posted @ 2022-03-28 17:56 zzy_C 阅读(40) 评论(0) 推荐(0)

摘要://#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int is_leap_year(int n) { if ((n % 4 == 0 && n % 100 !=0) || (n % 400 == 0)) re 阅读全文
posted @ 2022-03-28 17:40 zzy_C 阅读(41) 评论(0) 推荐(0)

摘要://#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int is_prime(int n) { //2->n-1之间的数字 int j = 0; for (j = 2; j < n; j++) { if (n 阅读全文
posted @ 2022-03-28 16:55 zzy_C 阅读(83) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include <string.h> void Swap(int* x,int* y) { int z; z = *x; *x = *y; *y = z; } int main() { int 阅读全文
posted @ 2022-03-28 14:54 zzy_C 阅读(90) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include <string.h> int get_max(int x, int y) { int z = 0; if (x > y) z = x; else z = y; return z; 阅读全文
posted @ 2022-03-28 14:52 zzy_C 阅读(329) 评论(0) 推荐(0)

摘要:问题描述:新机台JC5600发送的周期不对,发送1.2us的周期,采用示波器测量是1.5us。 验证结果:采用旧机台的TIM文件测试值正常 阅读全文
posted @ 2022-03-28 14:18 zzy_C 阅读(88) 评论(0) 推荐(0)

摘要:I/O函数 头文件#include<stdio.h> 字符串操作函数 头文件#include <string.h> 字符操作函数 头文件#include <ctype.h> 内存操作函数 头文件#include <string.h> 时间/日期函数 头文件#include <time.h> 数学函数 阅读全文
posted @ 2022-03-28 12:50 zzy_C 阅读(53) 评论(0) 推荐(0)

摘要:1.方案里的“0” “1”表示数据0和数据1。 2.例如数据格式,数据0的周期是1.2us 3.设速率为300,向量格式发(一个1,三个0)表示数据0。 阅读全文
posted @ 2022-03-26 18:06 zzy_C 阅读(66) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<stdlib.h> int main() { char input[20] = { 0 }; //shutdown -s -t 60 system("shutdown - s - 阅读全文
posted @ 2022-03-26 12:28 zzy_C 阅读(38) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> #include<stdlib.h> #include<time.h> int main() { again: printf("hello \n"); goto 阅读全文
posted @ 2022-03-26 11:30 zzy_C 阅读(42) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> #include<stdlib.h> #include<time.h> void menu() { printf("*******************\n") 阅读全文
posted @ 2022-03-26 11:25 zzy_C 阅读(219) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int main() { //乘法口诀表 //1*1=1 //2*1=2 2*2=4 //3*1=3 3*2=6 3*3=9 int i = 0; for (i 阅读全文
posted @ 2022-03-26 08:42 zzy_C 阅读(140) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int main() { //求最大值 求10个整数中的最大值 int arr[] = {-20,-2,-3,-4,-10,-6,-12,-8,-9,-5}; i 阅读全文
posted @ 2022-03-25 17:54 zzy_C 阅读(89) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int main() { //分数求和 1/1-1/2+1/3-1/4+1/5......+1/99-1/100的值,打印出结果 int i = 0; doubl 阅读全文
posted @ 2022-03-25 17:25 zzy_C 阅读(207) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int main() { //编写程序数一下 1到100的所有整数中出现多少个数字9 int i = 0; int count = 0; for (i < 1; 阅读全文
posted @ 2022-03-25 17:09 zzy_C 阅读(89) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<math.h> int main() { int i = 0; int count = 0; for (i = 101; i <= 200; i+=2) { //判断i是否是素数 阅读全文
posted @ 2022-03-25 16:00 zzy_C 阅读(46) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int main() { //打印1000-2000的闰年 //1.能被4整除并且不能被100整除是闰年 //2.能被400整除是闰年 int year = 0; int count = 0; f 阅读全文
posted @ 2022-03-24 18:29 zzy_C 阅读(63) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int main() { //最大公约数 //辗转相除法 int m = 24; int n = 18; int r = 0; while (m % n) { r = m % n; m = n; 阅读全文
posted @ 2022-03-24 17:32 zzy_C 阅读(38) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int main() { //打印3的倍数的数 //写一个代码打印1-100之间所有3的倍数的数字 int i=0; for (i = 1; i <= 100; i++) { if (i % 3 阅读全文
posted @ 2022-03-24 17:10 zzy_C 阅读(95) 评论(0) 推荐(0)

摘要:#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int main() //从大到小输出 { int a = 0; int b = 0; int c = 0; printf("请输入值:"); scanf("%d,%d,%d", &a, &b, 阅读全文
posted @ 2022-03-24 13:08 zzy_C 阅读(107) 评论(0) 推荐(0)

摘要:1 #define _CRT_SECURE_NO_WARNINGS 1 2 3 #include<stdio.h> 4 #include<string.h> 5 #include<Windows.h> 6 int main() 7 { 8 int i = 0; 9 char password[] = 阅读全文
posted @ 2022-03-23 17:42 zzy_C 阅读(52) 评论(0) 推荐(0)

摘要:C_练习 #define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int main() { int arr[] = { 1,2,3,4,5,6,7,8,9,10 }; int k = 7; int sz = sizeof(arr) / sizeof(a 阅读全文
posted @ 2022-03-23 13:35 zzy_C 阅读(39) 评论(0) 推荐(0)