#include <stdio.h>
#include <string.h>
#include <windows.h>
int main()
{
char str[100] = "HELLO WORLD! GOOD BYE!";
int i,j;
while(1)
{
for(i=0;i<strlen(str);i++)
{
system("cls");
for(j=i;j<strlen(str);j++)
{
printf("%c",str[j]);
}
Sleep(100);
printf("\n");
}
}
return 0;
}
system("CLS") 是在C語言程序中,調用系統命令cls完成清屏操作。
system("time /t") ;顯示時間
system("dir"); //列目錄
system("pause");來實現駐留。
system函數是C語言提供的與操作系統銜接的函數,函數原型如下:
#include <stdlib.h> //所在頭文件
int system(const char *command); //參數為操作系統命令
函數功能:execute a shell command 執行一個操作系統命令
