![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
XBS1999
这个作者很懒,什么都没留下…
展开
-
C语言冒泡排序法(升序)
#include <stdio.h>void bubble_sort(int arr[], int sz){ int m = 0; for (m = 0; m < sz - 1; m++) { int n = 0; int tem = 0; int finish = 1; for (n = 0; n < sz - 1 - m; n++) { if (arr[n] > arr[n + 1]) { tem = arr[n]; .原创 2021-09-18 15:34:48 · 243 阅读 · 0 评论 -
判断1000年---2000年之间的闰年
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>int main(){ int n = 0; int m = 0; for (n = 1000; n <= 2000; n++) { if (((n % 4 == 0) && (n % 100 != 0)) || (n % 400 == 0)) { printf("%d ", n...原创 2021-09-03 14:49:18 · 76 阅读 · 0 评论 -
打印100~200之间的素数(质数)
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>int main(){ int m = 0; int n = 0; int mun = 0; for (m = 100; m <= 200; m++) { for (n = 2; n <= m-1; n++) { mun = m % n; if (mun ==...原创 2021-09-03 13:56:41 · 121 阅读 · 0 评论 -
用户输入密码正确则登录成功,3次输入错误提示请退出
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>int main(){ int i = 0; char arr[20] = {0}; for (i = 0; i < 3; i++) { printf("请输入密码:>"); scanf("%s", arr); if (strcmp(arr, "XBS1241900451") == 0) ...原创 2021-09-03 09:12:34 · 1348 阅读 · 0 评论 -
输出乘法口诀表
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <string.h>#include <stdlib.h>#include <windows.h>int main(){ int m = 1; int n = 1; int mn = 0; for (n = 1; n <= 9; n++) { for (m = 1; m...原创 2021-09-02 17:10:32 · 71 阅读 · 0 评论