c語言表白!!!!(ps 偶然看到的)
阿新 • • 發佈:2019-01-22
#include<stdio.h> #include<string> #include<windows.h> int main() { char str[3]; int flag=1; flag:printf("Do you love me?\n"); scanf("%s",str); if(strcmp(str,"no")!=0&&strcmp(str,"NO")!=0) { printf("請重新輸入!!!\n"); goto flag; } while(strcmp(str,"yes")!=0&&strcmp(str,"YES")!=0) { flag=0; printf("I will be waiting for you\n"); Sleep(100); printf("\n"); printf("after a long time...\n"); printf("Do you love me?\n"); scanf("%s",str); } if(flag==1) printf("I love you,too\n"); else printf("I don't love you anymore\n"); system("pause"); return 0; }