#include <stdio.h>
#include <windows.h>
#include <string.h>
void Delay_Output_ENG(char MessageStr[],int sleep_time)
{
int i ;
int m;
m = strlen(MessageStr);
for(i=0;i<=m;i++)
{
printf("%c",MessageStr[i]);
Sleep(sleep_time);
}
printf("\n");
}
int main()
{
char msg_id ;
char test_string[] = "hello world";
char test_str[] = "Follow me";
int again_input =0;
for(;again_input == 0;)
{
scanf("%c",&msg_id);
switch(msg_id)
{
case 'Y':
case 'y':
Delay_Output_ENG(test_string,30);
again_input = 1;break;
case 'N':
case 'n':
Delay_Output_ENG(test_str,50);
again_input = 1;break;
default:
printf("Error please input again\n");//为什么输入一个数会跳出来两行
again_input =0;
break;
}
}
return 0;
}