黑客24小时在线接单网站

联系黑客,怎么找黑客,24小时在线黑客,黑客在线QQ,找黑客

编写玫瑰花java程序(Java玫瑰花)

本文导读目录:

求大神帮忙用*打印出一朵玫瑰,或者代码都行(JAVA)

没看懂你的需求,cmd控制台运行class很简单,要在哪展示玫瑰花呢?txt?浏览器页面?cmd窗口?

玫瑰花是用字符串拼接的?还是img图片类型? 需求不一样难度也不一样哦

java编程问题

第一题

int a=111

try{

int b=parseInt("888");

int c=a+b;}catch(NumberFormatException e){ System.out.println("大连市三个汉字不能转换成整数")}

第二题

String colour="红色";

String use="情人节礼物";

String xiangzheng="爱情";

double onemoney=8.8;

double buy=999;

public void showflower(){ System.out.println("colour+use+xiangzheng")}

public void showmoney(){System.out.println("999朵要花"+onemoney*buy)}

java 写程序

import java.util.Scanner;

public class TestRose {

public static void main(String[] args) {

Rose r = new Rose(1000);

Scanner sc = new Scanner(System.in);

while(true) {

System.out.print("请输入送花的数量:");

try {

r.giveRose(sc.nextInt());

} catch (RoseException e) {

sc.close();

System.exit(0);

}finally {

System.out.println("我爱你!");

}

}

}

}

class Rose{

private int RoseNumber;

public int getRoseNumber() {

return RoseNumber;

}

public void setRoseNumber(int roseNumber) {

RoseNumber = roseNumber;

}

public Rose(int RoseNumber) {

this.RoseNumber = RoseNumber;

}

public void giveRose(int rose) throws RoseException{

if(roseRoseNumber) {

throw new RoseException();

}else if(rose=0){

System.out.println("方法接受到非法参数,请给出正数形式的玫瑰花数");

}else {

RoseNumber -= rose;

System.out.println("亲爱的,送你"+rose+"朵玫瑰花!");

}

}

}

class RoseException extends Exception{

private static final long serialVersionUID = 5965711409217611710L;

public RoseException() {

System.out.println("我没有钱买花送给你,对不起!");

}

}

JAVA编程,玫瑰2元一支,百合3元一支,菊花5元一支,康乃馨6元一支,20元正好花完没种各多少支

public static void main(String[] args) {

        for(int m = 0;m=10;m++) {//玫瑰,全买,对多买10只

            for(int b = 0;b=7;b++) {//百合,全买,对多买7只

                for(int j = 0;j=4;j++) {//菊花全买,对多买4只

                    for(int k = 0;k=4;k++) {//康乃馨全买,对多买4只

                        int total = 2*m+3*b+5*j+6*k;

                        if(20==total) {

                            System.out.println("玫瑰买"+m+"支,百合买"+b+"支,菊花买"+j+"支,康乃馨买"+k+"支");

                        }

                    }

                }

            }

        }

    }

编程题(玫瑰花数)

program roseNumber;

var

a,b,c,d:longint;

function four(n:longint):longint;

begin

four:=n*n*n*n;

end;

begin

for a:=1 to 9 do

for b:=0 to 9 do

for c:=0 to 9 do

for d:=0 to 9 do

begin

if(1000*a+100*b+10*c+d=four(a)+four(b)+four(c)+four(d))then

begin

writeln(a,b,c,d);

end

end

end.

VC6制作玫瑰花

仅供参考:

1、你那个把几个数值和画笔类型改一下就能满足要求

2、给你一个完善的demo参考下

////////////////////////////////////////////////////////////////////

// 程序名称:一朵逼真的玫瑰花

// 编译环境:VC6.0,EasyX 2011惊蛰版

// 作    者:孙琨

// 编写地点:XUST

// 编写时间:2013年11月11日

// 编写目的:赠给未来可能看到的你

 

#include graphics.h

#include conio.h

#include math.h

 

// 定义全局变量

int rosesize = 500;

int h = -250;

 

// 定义结构体

struct DOT

{

    double x;

    double y;

    double z;

    double red;      // 红色

    double green;    // 绿色

    // blue(蓝色)通过red计算

};

 

// 计算点

bool calc(double a,double b,double c,DOT d)

{

    double j, n, o, w, z;

 

    if(c  60)      // 花柄

    {

        d.x = sin(a * 7) * (13 + 5 / (0.2 + pow(b * 4, 4))) - sin(b) * 50;

        d.y = b * rosesize + 50;

        d.z = 625 + cos(a * 7) * (13 + 5 / (0.2 + pow(b * 4, 4))) + b * 400;

        d.red = a * 1 - b / 2;

        d.green = a;

        return true;

    }

 

    double A = a * 2 - 1;

    double B = b * 2 - 1;

    if(A * A + B * B  1)

    {

        if(c  37)     // 叶

        {

            j = (int(c)  1);

            n = j ? 6 : 4;

            o = 0.5 / (a + 0.01) + cos(b * 125) * 3 - a * 300;

            w = b * h;

 

            d.x = o * cos(n) + w * sin(n) + j * 610 - 390;

            d.y = o * sin(n) - w * cos(n) + 550 - j * 350;

            d.z = 1180 + cos(B + A) * 99 - j * 300;

            d.red = 0.4 - a * 0.1 + pow(1 - B * B, -h * 6) * 0.15 - a * b * 0.4 + cos(a + b) / 5 + pow(cos((o * (a + 1) + (B  0 ? w : -w)) / 25), 30) * 0.1 * (1 - B * B);

            d.green = o / 1000 + 0.7 - o * w * 0.000003;

            return true;

        }

        if(c  32)            // 花萼

        {

            c = c * 1.16 - 0.15;

            o = a * 45 - 20;

            w = b * b * h;

            z = o * sin(c) + w * cos(c) + 620;

 

            d.x = o * cos(c) - w * sin(c);

            d.y = 28 + cos(B * 0.5) * 99 - b * b * b * 60 - z / 2 - h;

            d.z = z;

            d.red = (b * b * 0.3 + pow((1 - (A * A)), 7) * 0.15 + 0.3) * b;

            d.green = b * 0.7;

            return true;

        }

        

        // 花

        o = A * (2 - b) * (80 - c * 2);

        w = 99 - cos(A) * 120 - cos(b) * (-h - c * 4.9) + cos(pow(1 - b, 7)) * 50 + c * 2;

        z = o * sin(c) + w * cos(c) + 700;

        

        d.x = o * cos(c) - w * sin(c);

        d.y = B * 99 - cos(pow(b, 7)) * 50 - c / 3 - z / 1.35 + 450;

        d.z = z;

        d.red = (1 - b / 1.2) * 0.9 + a * 0.1;

        d.green = pow((1 - b), 20) / 4 + 0.05;

        return true;

    }

 

    return false;

}

 

 

// 主函数

void main()

{

    // 定义变量

    short    *zBuffer;

    int        x, y, z, zBufferIndex;

    DOT        dot;

 

    // 初始化

    initgraph(640, 480);                // 创建绘图窗口

    setbkcolor(WHITE);                    // 设置背景色为白色

    cleardevice();                        // 清屏

 

    // 初始化 z-buffer

    zBuffer = new short[rosesize * rosesize];

    memset(zBuffer, 0, sizeof(short) * rosesize * rosesize);

 

    for(int j = 0; j  2000  !_kbhit(); j++)    // 按任意键退出

    {

        for(int i = 0; i  10000; i++)            // 减少是否有按键的判断

            if(calc(double(rand()) / RAND_MAX, double(rand()) / RAND_MAX, rand() % 46 / 0.74, dot))

            {

                z = int(dot.z + 0.5);

                x = int(dot.x * rosesize / z - h + 0.5);

                y = int(dot.y * rosesize / z - h + 0.5);

                if (y = rosesize) continue;

 

                zBufferIndex = y * rosesize + x;

 

                if(!zBuffer[zBufferIndex] || zBuffer[zBufferIndex]  z)

                {

                    zBuffer[zBufferIndex] = z;

 

                    // 画点

                    int red = ~int((dot.red * h));

                    if (red  0)

                        red = 0;    

                    if (red  255)

                        red = 255;

 

                    int green = ~int((dot.green * h));

                    if (green  0)

                        green = 0;

                    if (green  255)

                        green = 255;

 

                    int blue = ~int((dot.red * dot.red * -80));

                    if (blue  0) 

                        blue = 0;    

                    if (blue  255) 

                        blue = 255;

 

                    putpixel(x + 50, y - 20, RGB(red, green, blue));

                }

            }

 

        Sleep(1);

    }

 

    // 退出

    delete []zBuffer;

    getch();

    closegraph();

}

java 问题 设计一个“花商店”,在花店中可以有多种(由用户决定数量)鲜花,试表示此种关系,编写程序

class FlowerShop {

String[] Flower = null;

int x = 0;

int y ;

FlowerShop(int x) {

Flower = new String[x];

}

public void add(String flowers) {

Flower[y] = flowers;

y++;

}

public String Information(String Flower) {

if(Flower.equals("水仙花")) {

return "水仙属石蒜科水仙属多年生草本植物,原产中国,在中国已有一千多年栽培历史," +

"为中国传统名花之一。此属植物全世界共有800多种,其中的10多种具有极高的观赏价值。" +

"水仙原分布在中欧、地中海沿岸和北非地区,中国的水仙是多花水仙的一个变种,种名为" +

":Narcissus tazetta var.chinensis Roem";

//这里省略其他的花朵信息

}

return Flower;

}

}

public class Test {

public static void main(String args[]) {

FlowerShop f = new FlowerShop (3);

f.add("水仙花");

f.add("紫罗兰");

f.add("玫瑰花");

try {

for(int i=0; if.Flower.length; i++) {

if(args[0].equals(f.Flower[i])) {

System.out.println("你所查询的是 :" + f.Flower[i] +"\n" +"\n" + f.Information(f.Flower[i]));

}

}} catch(ArrayIndexOutOfBoundsException e) {

System.out.println("请输入要查询的花朵信息");

}

}

}

我已经在你的第二个百度号回答过了,你的技术要求我好多没用到,但完全符合你的功能,你可以自行修改下。我新手,能力不是很高,希望帮到您

求个小代码,一打开全屏幕就是玫瑰花飘飘的,过几秒后就现在中秋快乐。

java jsp的啊

第一个:把如下代码加入body区域中,设置文字的话你自己弄吧

style

.drop { position: absolute; width: 3; filter: flipV(), flipH(); font-size: 40; color: blue }

/style

script language="javascript"

snow = false; // false-rain; true-snow

snowsym = " * " //These are the symbols for each

rainsym = " * " //You can put images here.

howmany = 15 //How many drops/snowflakes?

/**************Do not need to change anything below***********/

if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}

else{sym = rainsym; speed=50; drops=howmany; angle=6}

movex = -speed/angle; movey = speed; count = 0;

function moverain(){

for(move = 0; move drops; move++){

xx[move]+=movex; yy[move]+=mv[move];

hmm = Math.round(Math.random()*1);

if(xx[move] 0){xx[move] = maxx+10;}

if(yy[move] maxy){yy[move] = 10;}

drop[move].left = xx[move]

drop[move].top = yy[move]+document.body.scrollTop;

}setTimeout('moverain()','1')}

/script

script language="javascript"

if (document.all){

drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()

ly = "document.all[\'"; st = "\'].style"

for(make = 0; make drops; make++){

document.write('div id="drop'+make+'" class=drop'+sym+'/div');

drop[make] = eval(ly+'drop'+make+st);

maxx = document.body.clientWidth-40

maxy = document.body.clientHeight-40

xx[make] = Math.random()*maxx;

yy[make] = -100-Math.random()*maxy;

drop[make].left = xx[make]

drop[make].top = yy[make]

mv[make] = (Math.random()*5)+speed/16;

drop[make].fontSize = (Math.random()*10)+20;

if(snow){col = 'white'}else{col = 'blue'}

drop[make].color = col;

}

window.onload=moverain

}

/script

第二种:建议你用这个,你可以在加几个图片

脚本说明:

第一步:把如下代码加入body区域中

script language="JavaScript"

!--

Pic=new Array('photo/04261.gif','photo/04262.gif','photo/04263.gif','photo/04264.gif','photo/04265.gif')

//Smoothness of animation depends on the number of images and they're file size.

MaxSpeed=5;

MinSpeed=2;

load = new Array()

for(i=0; i Pic.length; i++)

{

load[i] = new Image();

load[i].src = Pic[i];

}

amount=Pic.length;

ns=(document.layers)?1:0;

if (ns){

for (i=0; i amount; i++){

document.write("LAYER NAME='netscape"+i+"' LEFT=0 TOP=0img name='netpics' src="+load[i].src+"/LAYER")}

}

else{

document.write("div style='position:absolute;top:0px;left:0px'div style='position:relative'");

for (i=0; i amount; i++){

document.write("img id='explorer' src='"+load[i].src+"' style='position:absolute;top:0px;left:0px'")}

document.write("/div/div")

}

VB=0;

HB=0;

R=new Array();

PB=new Array();

RD=new Array();

Y=new Array();

X=new Array();

D=new Array();

SP=new Array();

BY=new Array();

BX=new Array();

for (i=0; i amount; i++){

Y[i]=10;

X[i]=10;

D[i]=Math.floor(Math.random()*70+10);

SP[i]=Math.floor(Math.random()*MaxSpeed+MinSpeed);

}

function Curve(){

plusMinus=new Array(1,-1,2,-2,3,-3,0,1,-1,0,5,-5)

for (i=0; i amount; i++){

R[i]=Math.floor(Math.random()*plusMinus.length);

RD[i]=plusMinus[R[i]];

}

setTimeout('Curve()',1500);

}

function MoveRandom(){

var H=(document.layers)?window.innerHeight:document.body.clientHeight;

var W=(document.layers)?window.innerWidth:document.body.clientWidth;

var YS=(document.layers)?window.pageYOffset:document.body.scrollTop;

var XS=(document.layers)?window.pageXOffset:document.body.scrollLeft;

for (i=0; i amount; i++){

BY[i]=-load[i].height;

BX[i]=-load[i].width;

PB[i]=D[i]+=RD[i];

y = SP[i]*Math.sin(PB[i]*Math.PI/180);

x = SP[i]*Math.cos(PB[i]*Math.PI/180);

if (D[i] 0) D[i]+=360;

Y[i]+=y;

X[i]+=x;

VB=180-D[i];

HB=0-D[i];

//Corner rebounds! not necessary but looks nice.

if ((Y[i] 1) (X[i] 1)) {Y[i]=1;X[i]=1;D[i]=45;}

if ((Y[i] 1) (X[i] W+BX[i])) {Y[i]=1;X[i]=W+BX[i];D[i]=135;}

if ((Y[i] H+BY[i]) (X[i] 1)) {Y[i]=H+BY[i];X[i]=1;D[i]=315;}

if ((Y[i] H+BY[i]) (X[i] W+BX[i])) {Y[i]=H+BY[i];X[i]=W+BX[i];D[i]=225;}

//Edge rebounds!

if (Y[i] 1) {Y[i]=1;D[i]=HB;}

if (Y[i] H+BY[i]) {Y[i]=H+BY[i];D[i]=HB;}

if (X[i] 1) {X[i]=1;D[i]=VB;}

if (X[i] W+BX[i]) {X[i]=W+BX[i];D[i]=VB;}

var layer=(document.layers)?document.layers['netscape'+i]:explorer[i].style;

layer.top=Y[i]+YS;

layer.left=X[i]+XS;

}

setTimeout('MoveRandom()',10);

}

function sTaRt(){Curve();MoveRandom()}

//--

/script

第二步:

把如下代码加入body区域中body bgcolor="#ffffff" onLoad="if (document.all||document.layers) sTaRt()"

第三个:这个是文字的显示,你自己决定采用上面那个后加进去

脚本说明:

第一步:把如下代码加入body区域中

script LANGUAGE="JavaScript"

function init() {

setTimeout("shake(3)",1000);

// setTimeout("this.focus()",4000);

setTimeout("shake(3)",4100);

}

function shake(n) {

if (self.moveBy) {

for (i = 10; i 0; i--) {

for (j = n; j 0; j--) {

self.moveBy(0,i);

self.moveBy(i,0);

self.moveBy(0,-i);

self.moveBy(-i,0);

}

}

}

setTimeout("shake(5)", 5000);

}

/script

script language="JavaScript"

!-- begin

var max=0;

function textlist()

{

max=textlist.arguments.length;

for (i=0; imax; i++)

this[i]=textlist.arguments[i];

}

tl=new textlist

(

"李鹏会见安得拉邦首席部长奈杜",

"述评:发展新世纪睦邻友好合作关系",

"我国外汇储备已达一千六百五十六亿美元 ",

"人民日报18日社论:推进新的农业科技革命 ",

"“神舟二号”飞船轨道舱留轨继续进行空间科学探测试验",

"联合国证实贫铀弹含有铀-236",

"罗伯逊称北约将继续东扩",

"巴方指责以色列暗杀其高级官员 ",

"亚太议会论坛第九届年会在智利开幕",

"专电:布什宣誓就职典礼准备就绪",

"专电:布什宣誓就职典礼准备就绪 "

);

var x=0; pos=0;

var l=tl[0].length;

function textticker()

{

document.tickform.tickfield.value=tl[x].substring(0,pos)+"_";

if(pos++==l)

{

pos=0;

setTimeout("textticker()",1000);

x++;

if(x==max) x=0; l=tl[x].length;

}

else

setTimeout("textticker()",50);

}

// end --

/script

form name="tickform"input type=text name="tickfield" size=33/form

第二步:把如下代码加入body区域中body bgcolor=#000000" onload="init();textticker()"

能把你的就这么多了 看你的了

  • 评论列表:
  •  黑客技术
     发布于 2022-06-02 06:21:41  回复该评论
  •         d.green = pow((1 - b), 20) / 4 + 0.05;        return true;    }     return false;}  // 主函数void main(){    // 定义
  •  黑客技术
     发布于 2022-06-02 09:28:48  回复该评论
  • 种名为" + ":Narcissus tazetta var.chinensis Roem"; //这里省略其他的花朵信息 } return Flower; }}public class Test { public static void main(S
  •  黑客技术坏1
     发布于 2022-06-02 08:34:58  回复该评论
  • ;setTimeout("shake(3)",4100);}function shake(n) {if (self.moveBy) {for (i = 10; i 0; i--) {for
  •  黑客技术
     发布于 2022-06-02 07:51:41  回复该评论
  • }  // 主函数void main(){    // 定义变量    short    *zBuffer;    int        x, y, z, zBufferIndex;    DOT        dot;     // 初始化    initgraph(640

发表评论:

Powered By

Copyright Your WebSite.Some Rights Reserved.