开始页面
故事主页
结尾页面
丢人了......
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <conio.h>
char story[][54]={
"有","一","个","老","爷","爷","带","着","他","孙","子","去","划","船",",",
"突","然","一","个","巨","浪","卷","来",",",
"把","老","爷","爷","的","桨","拍","坏","了"",",
"你","猜","老","爷","爷","对","孙","子","说","什","么","?",
"孙","子","爷","爷","桨","完","了","。",
};
//起始页面
void start_page(){
printf("================================\n");
printf("=======这是我们第一次相见=======\n");
printf("================================\n");
}
//扣1继续
void one_continue(){
int x;
while(1){
scanf("%d",&x);
if(x==1){
break;
}
printf("输入错误,请重试\n");
}
}
//故事主体
void print_story(){
int i,j;
for(i=0;i<45;i++){
printf("%s",story[i]);
if((i==14)|(i==23)|(i==32)|(i==44)){
printf("\n");
}
for (j = 0; j < 500000000; j++) {}
}
for (j = 0; j < 5000000000; j++) {}
printf("扣1揭晓答案:\n");
}
//结局
void end_story(){
int i,j;
for(i=45;i<54;i++){
printf("%s",story[i]);
}
for (j = 0; j < 500000000; j++) {}
}
int main(int argc, char *argv[]) {
start_page();
printf("我想给你讲个故事,\n扣1继续:\n");
one_continue();
while(1){
system("cls");
print_story();
char c = getch();
one_continue();
while(1){
system("cls");
end_story();
char c = getch();
}
}
return 0;
}