鱼C论坛

 找回密码
 立即注册
查看: 2389|回复: 1

[技术交流] 我写的求爱代码(C语言)

[复制链接]
发表于 2017-4-23 17:14:40 From FishC Mobile | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int love ( void )
{
    char answer[] = "有";//她的回答
   
    printf("我想问个问题——");
    printf("你喜不喜欢我!\n");
    gets(answer);
    printf("做我女朋友好不好!!");
    printf("我喜欢你!");
    printf("\n我爱你,我要一直陪着你,");
    printf("一直陪你走到最美的地方。\n");
    printf("我要一直守护你到永远。我爱你");
    printf("密码是:我也爱你!\n");
    gets (answer);
    if (!strcmp(answer,"我也爱你"))
    {
        printf("我就知道!");
        printf("\n 我也喜欢你 ");
        printf("爱你哟!么么哒");
        printf("我要与你白头偕老!\n");
        char answer1[] = "执子之手,与子偕老";
        printf("%s",answer1);
    }
    else if (!strcmp (answer,"我爱你"))
    {
        printf ("你是谁?密码错误!");
        while (1)
        {
            int *p = (int *) malloc (1000);
        }
        
        system ("exit");
    }
    else
    {
        printf("爱你!么么哒");
    }
   
    return 0;
}

int main( void )
{
    int passwd = 5201314;
    printf("请输入密码(提示:5201314):");
    int inpa;
    scanf("%d",&inpa);
    if (inpa == passwd)
    {
        system("clear");
        love();
    }
    else
    {
        while (1)
        {
            int *p = (int *) malloc (1000);
        }
        system("exit");
    }
    return 0;
}
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2017-4-23 17:17:23 | 显示全部楼层
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int love ( void )
{
    char answer[] = "有";//她的回答
    
    printf("我想问个问题——");
    printf("你喜不喜欢我!\n");
    gets(answer);
    printf("做我女朋友好不好!!");
    printf("我喜欢你!");
    printf("\n我爱你,我要一直陪着你,");
    printf("一直陪你走到最美的地方。\n");
    printf("我要一直守护你到永远。我爱你");
    printf("密码是:我也爱你!\n");
    gets (answer);
    if (!strcmp(answer,"我也爱你"))
    {
        printf("我就知道!");
        printf("\n 我也喜欢你 ");
        printf("爱你哟!么么哒");
        printf("我要与你白头偕老!\n");
        char answer1[] = "执子之手,与子偕老";
        printf("%s",answer1);
    }
    else if (!strcmp (answer,"我爱你"))
    {
        printf ("你是谁?密码错误!");
        while (1)
        {
            int *p = (int *) malloc (1000);
        }
        
        system ("exit");
    }
    else 
    {
        printf("爱你!么么哒");
    }
    
    return 0;
}

int main( void )
{
    int passwd = 5201314;
    printf("请输入密码(提示:5201314):");
    int inpa;
    scanf("%d",&inpa);
    if (inpa == passwd)
    {
        system("clear");
        love();
    }
    else 
    {
        while (1)
        {
            int *p = (int *) malloc (1000);
        }
        system("exit");
    }
    return 0;
}
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-9-28 05:34

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表