- 博客(6)
- 收藏
- 关注
原创 C语言 推箱子游戏
#include <iostream>#include <cstdio>#include <string.h>#include <conio.h>#include <windows.h>using namespace std;int main(){ char a[50][50]={"##########", "## ###", "##X##
2021-02-04 11:53:36
336
原创 C语言 getche()与getch() #include<conio.h>
getchar()读取一个字符,等待用户按enter后结束(带回显)getche()读取一个字符,输入后立刻获取字符,不用按enter(带回显)getch()读取一个字符,输入后立刻获取字符,不用按enter(不带回显)注意:使用getche()和getch()需要导入#include<conio.h>...
2021-01-30 22:45:23
1127
原创 C语言 编写倒计时程序
编写一个两分钟的倒计时。形如2:00 1:59 1:58 1:57…1:00 0:59 0:58…0:01 0:00#include <iostream>#include <cstdio>#include<windows.h>using namespace std;int main(){ int a=2,b=0; while(a>=0){ printf("%d:%02d",a,b);
2021-01-22 16:02:03
11761
1
原创 C语言 输入一个整数n,求出其阶乘
输入一个整数n,求出其阶乘#include <iostream>#include <cstdio>using namespace std;int main(){ int a=1,n; printf("输入整数n的值:"); scanf("%d",&n); while(n>0){ a=n*a; n=n-1; } printf("%d\n",a);
2021-01-22 15:24:38
10467
4
原创 C语言 依次打印1、2、3…99、100、99、98、97…1
C语言 依次打印1、2、3…99、100、99、98、97…1#include <iostream>#include <cstdio>using namespace std;int main(){ int a=1; while(a<=99){ printf("%d ",a); a=a+1;} while(a>0){ printf("%d ",a); a=a-1;
2021-01-22 14:48:42
1009
原创 C语言键盘输入任意四个整数,将其从小到大排列
键盘输入任意四个整数,将其从小到大排列#include <iostream>#include <cstdio>using namespace std;int main(){ int a,b,c,d,t; printf("数字排序程序\n"); printf("输入四个数用空格隔开:"); scanf("%d %d %d %d",&a,&b,&c,&d); if(a>b){t=a,a=b,b=t;}
2021-01-16 23:22:36
29613
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人