首页新闻招聘找找看知识库

各位大牛 帮帮忙 QAQ

-4
悬赏园豆:10 [待解决问题]

各位大神  今天是情人节 请问谁能给小弟用C# new一个女朋友  

一切至于创新的主页 一切至于创新 | 初学一级 | 园豆:189
提问于:2018-02-14 13:56
< >
分享
所有回答(3)
-2

女朋友  girl=new 女朋友;

gril.boyfirend.nickname="一切至于创新";

落幕 | 园豆:212 (菜鸟二级) | 2018-02-14 14:39
0

我可以用JAVA给你new一个,你要的女朋友到了

package girl.friend;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;

public class GirlFriend {
    private int status;
    
    private String name;
    
    public static void main(String[] args) 
    {
        // for test
        GirlFriend herName = new GirlFriend("hername");
        herName.now();
        herName.weGoOn().weGoOn();
        herName.now();
        
        herName.weLife();
    }
    
    /**
     * \u2665 实心 \u2764 粗心
     * @param tab 基础缩进
     * @param shape 瘦 正常 胖
     */
    public static void printHeart(int tab, int shape)
    {
        switch(shape)
        {
        case 1://瘦
            System.out.println();
            printTab(tab + 8);
            System.out.println("\u2665       \u2665");
            printTab(tab + 6);
            System.out.println("\u2665   \u2665   \u2665   \u2665");
            printTab(tab + 5);
            System.out.println("\u2665     \u2665 \u2665     \u2665");
            printTab(tab + 4);
            System.out.println("\u2665       \u2665       \u2665");
            printTab(tab + 5);
            System.out.println("\u2665      \u2665      \u2665");
            printTab(tab);
            System.out.println(">>>----I-love-you!------>");
            printTab(tab + 7);
            System.out.println("\u2665         \u2665");
            printTab(tab + 9);
            System.out.println("\u2665     \u2665");
            printTab(tab + 10);
            System.out.println("\u2665   \u2665");
            printTab(tab + 11);
            System.out.println("\u2665 \u2665");
            printTab(tab + 12);
            System.out.println("\u2665");  // 
            break;
        case 2://正常
            System.out.println();
            printTab(tab + 8);
            System.out.println("\u2665 \u2665         \u2665 \u2665");
            printTab(tab + 6);
            System.out.println("\u2665     \u2665     \u2665     \u2665");
            printTab(tab + 5);
            System.out.println("\u2665       \u2665   \u2665       \u2665");
            printTab(tab + 4);
            System.out.println("\u2665          \u2665          \u2665");
            printTab(tab + 5);
            System.out.println("\u2665         \u2665         \u2665");
            printTab(tab);
            System.out.println(">>>--------I-love-you!-------->");
            printTab(tab + 7);
            System.out.println("\u2665               \u2665");
            printTab(tab + 9);
            System.out.println("\u2665           \u2665");
            printTab(tab + 11);
            System.out.println("\u2665       \u2665");
            printTab(tab + 13);
            System.out.println("\u2665   \u2665");
            printTab(tab + 15);
            System.out.println("\u2665");
            break;
        case 3://胖
            System.out.println();
            printTab(tab + 9);
            System.out.println("\u2665 \u2665             \u2665 \u2665");
            printTab(tab + 6);
            System.out.println("\u2665       \u2665       \u2665       \u2665");
            printTab(tab + 5);
            System.out.println("\u2665         \u2665     \u2665         \u2665");
            printTab(tab + 4);
            System.out.println("\u2665             \u2665             \u2665");
            printTab(tab + 5);
            System.out.println("\u2665            \u2665            \u2665");
            printTab(tab);
            System.out.println(">>>-----------I-love-you!----------->");
            printTab(tab + 8);
            System.out.println("\u2665                   \u2665");
            printTab(tab + 10);
            System.out.println("\u2665               \u2665");
            printTab(tab + 12);
            System.out.println("\u2665           \u2665");
            printTab(tab + 14);
            System.out.println("\u2665       \u2665");
            printTab(tab + 18);
            System.out.println("\u2665");
            break;
        default:
        }
    }
    
    public static void printTab(int tab)
    {
        for(int i = 0; i < tab; i++)
        {
            System.out.print(" ");
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public GirlFriend(String name) {
        this.name = name;
        this.status = 3;
    }
    
    private static List<String> statusList = new ArrayList<>();
    static
    {
        statusList.add("天涯不相知");
        statusList.add("前世一千次的回哞,才换来今生的一次擦肩而过");
        statusList.add("做我女朋友");
        statusList.add("女朋友,不漏气");
        statusList.add("亲她,亲她");
        statusList.add("上得厅堂,下得厨房,还会暖床");
        statusList.add("相夫教子");
        statusList.add("当你老了");
        statusList.add("天人永隔");
        statusList.add("永远伴你身旁");
    }
    
    public void now()
    {
        System.out.println("[" + name + "]" + ": " + statusList.get(status));
    }
    
    public void next()
    {
        int temp = status;
        if(status < statusList.size() -1)
            temp++;
        System.out.println("[" + name + "]" + ": " + statusList.get(temp));
    }
    
    public void before()
    {
        int temp = status;
        if(status > 0)
            temp--;
        System.out.println("[" + name + "]" + ": " + statusList.get(temp));
    }
    
    public GirlFriend weGoOn()
    {
        if(status < statusList.size() - 1)
            status++;
        
        return this;
    }
    
    public GirlFriend ifGoBack()
    {
        if(status > 0)
            status--;
        
        return this;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
    
    public void weLife()
    {
        Iterator<String> it = statusList.iterator();
        while(it.hasNext())
        {
            try {
                System.out.println("[" + name + "]: " + it.next());
                Thread.sleep(2000);
                printHeart(5, (int)(new Random().nextFloat()*3) + 1);
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                return;
            }
        }
    }
}

最后,不要老想着新女朋友,从一而终比较好。

一座城你说你不懂 | 园豆:656 (小虾三级) | 2018-02-16 17:10
0

送你一对象

ycyzharry | 园豆:7937 (大侠五级) | 2018-02-22 09:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册