From ef45c7b594c23d375f4779b6bb93cf71e70736b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=96=87=E4=BF=8A?= <18408000201@stu.hut.edu.cn> Date: Wed, 9 Jan 2019 13:49:23 +0800 Subject: [PATCH] last commit --- 未命名5.cpp | 137 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 未命名5.cpp diff --git a/未命名5.cpp b/未命名5.cpp new file mode 100644 index 0000000..85c92fe --- /dev/null +++ b/未命名5.cpp @@ -0,0 +1,137 @@ +#include +#include +#include +/*6*/ +void Yellow(){ +{ system("color e"); + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + if((i+j)%2==0) + { + + + printf("%c%c",168,128); + } + else + { + printf(" "); + } + } + printf("\n"); + } +} + } +void White() +{/*ӡ*/ +/*޷ͼ⣬ascall168128Լո̸*/ + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + if((i+j)%2==0) + { + printf("%c%c",168,128); + } + else + { + printf(" "); + } + } + printf("\n"); + } +} +void Red(){ + { system("color c"); + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + if((i+j)%2==0) + { + + + printf("%c%c",168,128); + } + else + { + printf(" "); + } + } + printf("\n"); + } +} +} +void Blue(){ +{ system("color 9"); + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + if((i+j)%2==0) + { + + + printf("%c%c",168,128); + } + else + { + printf(" "); + } + } + printf("\n"); + } +} + } +void Purple(){ + { system("color d"); + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + if((i+j)%2==0) + { + + + printf("%c%c",168,128); + } + else + { + printf(" "); + } + } + printf("\n"); + } +} +} +void Goodbye(){printf("Goodbye!\n");} +/*ƾgoodbye*/ + +int main() +{ +/*˳ص״̬*/ +bool quit=false; +int input; +/*ѭ*/ +while(!quit) +{ +/*ӡ˵*/ +printf("ӭƹ\n"); +printf("ִҪɫ\n") ; +printf(" 1.Yellow\n 2.White\n 3.Blue\n 4.Red\n 5.Purple\n 6.Goodbye! Input 1-6:"); +/*,޶1-6ΪϷַ*/ +input=getchar()-0x30,getchar(); +/*ѡ֧*/ +switch(input) +{ +case 1:Yellow();quit=true;break;/*ɣ˳*/ +case 2:White();quit=true;break; +case 3:Blue();quit=true;break; +case 4:Red();quit=true;break; +case 5:Purple();quit=true;break; +case 6:Goodbye();quit=true;break; +default:break; +} +} +}