首先我最开始的尝试就是用先输出一个H ,然后继续在下面输出一个带空格的H,但如果我想要让H跑起来的话,还不够,于是我引入了system("cls")与,<windows.h>,
#include <stdio.h>
#include <stdlib.h>
#include <windows .h>
int main( )
int a;
system("cls") ;
printf ("H") ;
Sleep (1000) ;
system("cls") ;
printf (" H") ;
Sleep (1000) ;
system("cls") ;
printf ("
H") ;
system ("pause") ;
return 0;
但是,在途中我又想到如果我进行长时间的奔跑的话,那就变得太麻烦了,于是
#include <iostream>
#include<cstdio>
using namespace std;
int main( )
{
int a;
a=0;
while(a<=2)
{
system("cls");
printf("H");
a=a+1;
}
return 0;
但是这样他反而不动了,我要让他动起来,完成一个完全体
#include<cstdio>
#include<windows. h>
using namespace std;
int main( )
{
int a,b;
a=0;
while(a<=5)
{
system("cls");
b=1 ;
while(b<=a)
{
printf(" ");
b=b+1 ;
}
printf("H");
Sleep(1000) ;
a=a+1;
system("pause" ) ;
return 0;
}
最终完成