可以左右移动和跳跃,很简陋,不喜勿喷,毕竟这是我自己没看教程做出来的,感谢同机房同学ZYH和ZCN的灵感和支持
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
typedef double db;
typedef unsigned us;
typedef long long ll;
char c[105];
int jp,a=-1;
int main(){
int x=25;
memset(c,' ',sizeof c);
for(int i=0;i<100;i++)c[i]='.';
c[25]='#';
while(1){
system("cls");
if(jp>0){
if(jp==10)jp--,a=0;
for(int i=1;i<=10-jp;i++)cout<<"\n";
for(int i=1;i<=x;i++)cout<<" ";
cout<<"#";
for(int i=1;i<=jp;i++)cout<<"\n";
c[x]='.';
cout<<c;
}else c[x]='#',cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<c,a=-1;
Sleep(20);
if(GetAsyncKeyState(VK_RIGHT)&&x<98)c[x+2]='#',c[x]='.',x+=2;
if(GetAsyncKeyState(VK_LEFT)&&x>1)c[x-2]='#',c[x]='.',x-=2;
if(GetAsyncKeyState(VK_UP)&&a==-1)jp++,a=1;
if(a==0)jp--;
if(a==1)jp++;
}
return 0;
}