摘要: int get_max(int x, int y)//返回整型用int,x和y是形式参数。{ return (x > y) ? (x):(y);}//void swap1(int* x, int* y)void swap2(int &x,int &y) { int tmp = 0; tmp = x; 阅读全文
posted @ 2022-12-09 20:38 小蠕虫 阅读(38) 评论(0) 推荐(0)
摘要: int main(){ char arr1[] ="hello"; char arr2[20] = "#########"; //arr2[]copy时把arr1[]里的结束\0也复制过来了,所以打印遇到\0结束打印 strcpy(arr2, arr1); memset(arr1, '#', 2); 阅读全文
posted @ 2022-12-09 19:15 小蠕虫 阅读(24) 评论(0) 推荐(0)
摘要: int main(){ char arr[20]; system("shutdown /s /t 120");//调用库函数system,需引用(stdlib.h) again://可以用while(1)break代替来代替goto; printf("温馨提示:你的电脑将在2分钟内关机,\n如果输入 阅读全文
posted @ 2022-12-09 14:04 小蠕虫 阅读(84) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<math.h>#include<stdlib.h>#include<time.h> void menu(){ printf("*********************************************\n"); printf("** 阅读全文
posted @ 2022-12-09 12:53 小蠕虫 阅读(143) 评论(0) 推荐(0)