【爱心2】JAVA表白代码——“LOVE“

编程知识 更新时间:2023-04-07 06:06:11

Falling in love with you is the easiest thing I've ever done, nothing is more important than you!

好多话想说,但最终还是没说出口,它在春风中吻向你的眉眼,在日落晚霞里描摹你的容颜,在我看向你的眼神中隐忍而又热烈。所以借这个代码表达出你的心声,别让等待成为遗憾!

代码如下:

public class love {
    public static void main(String[] args) throws InterruptedException{
        int count=0;
        for (float y=2.5f;y>-2.0f;y-=0.12f){
            for (float x=-2.3f;x<2.3f;x+=0.041f){
                float a =x*x+y*y-4f;
                if((a*a*a-x*x*y*y*y)<-0.0f){
                    String str="LOVE";
                    int num =count%str.length();
                    System.err.print(str.charAt(num));
                    count++;
                }
                else{
                    System.err.print(" ");
                }
            }
            System.err.println();
            Thread.sleep(100);
        }
        System.out.println("如果能好好被爱!");
        System.out.println("谁不想呆在一个人身边一年有一年呢!");
    }
}

效果图如下:

 有兴趣的朋友可以试试!

更多推荐

【爱心2】JAVA表白代码——“LOVE“

本文发布于:2023-04-07 06:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/e02c9aef84730705f79c0188405955a9.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:爱心   代码   JAVA   LOVE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 52460文章数
  • 14阅读数
  • 0评论数