啊哈磊_编程从这里起步

标题: 如何实现“h”一直循环下去? [打印本页]

作者: 独秀同学    时间: 2018-7-19 20:10
标题: 如何实现“h”一直循环下去?
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
  int a,b;
     a=0;
     while(a<=2)
     {
      system("cls");
      b=1;
      while(b<=a)
         {
      printf(" ");
      b=b+1;
         }
      printf("H");
      Sleep(1000);
      a=a+1;
      }
system("pause");
return 0;
}


作者: 雨文/tp    时间: 2018-7-19 22:55

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
  int a,b;
     a=0;
     while(1)
     {
      system("cls");
      b=1;
      while(b<=a)
         {
      printf(" ");
      b=b+1;
         }
      printf("H");
      Sleep(1000);
      a=a+1;
      }
system("pause");
return 0;
}
看看是不是这样! 互相学习!
作者: HZN    时间: 2018-7-25 18:03
#include<cstdio>
#include <windows.h>
int main()
{
        while (1>0)
        {
                printf("H ");
                Sleep(50);
        }
        return 0;
}




欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2