C#写的全屏玫瑰的程序源码,名称是loverose 可以运行的,

C#写的全屏玫瑰的程序源码,名称是loverose 可以运行的,,第1张

public class Form1{

public SystemComponentModelIContainer components = null;

public override void Dispose(bool disposing)

{

if (disposing && (components != null)){

componentsDispose();

}

baseDispose(disposing);

}

public void InitializeComponent()

{

thiscomponents = new SystemComponentModelContainer();

SystemComponentModelComponentResourceManager resources = new SystemComponentModelComponentResourceManager(typeof(Form1));

thistimer1 = new SystemWindowsFormsTimer(thiscomponents);

thisimageList1 = new SystemWindowsFormsImageList(thiscomponents);

thisSuspendLayout();

thistimer1Enabled = true;

thistimer1Interval = 1000;

thistimer1Tick += new SystemEventHandler(thistimer1_Tick);

thisimageList1ImageStream = ((SystemWindowsFormsImageListStreamer)(resourcesGetObject("imageList1ImageStream")));

thisimageList1TransparentColor = SystemDrawingColorTransparent;

thisimageList1ImagesSetKeyName(0, "55jpg");

thisimageList1ImagesSetKeyName(1, "1jpg");

thisimageList1ImagesSetKeyName(2, "2jpg");

thisimageList1ImagesSetKeyName(3, "3jpg");

thisimageList1ImagesSetKeyName(4, "4jpg");

thisimageList1ImagesSetKeyName(5, "5jpg");

thisimageList1ImagesSetKeyName(6, "6jpg");

thisimageList1ImagesSetKeyName(7, "7jpg");

thisimageList1ImagesSetKeyName(8, "33jpg");

thisimageList1ImagesSetKeyName(9, "53jpg");

thisAutoScaleDimensions = new SystemDrawingSizeF(6F, 12F);

thisAutoScaleMode = SystemWindowsFormsAutoScaleModeFont;

thisBackgroundImage = ((SystemDrawingImage)(resourcesGetObject("$thisBackgroundImage")));

thisBackgroundImageLayout = SystemWindowsFormsImageLayoutStretch;

thisClientSize = new SystemDrawingSize(126, 131);

thisFormBorderStyle = SystemWindowsFormsFormBorderStyleNone;

thisName = "Form1";

thisShowInTaskbar = false;

thisStartPosition = SystemWindowsFormsFormStartPositionManual;

thisTopMost = true;

thisMouseDown += new SystemWindowsFormsMouseEventHandler(thisForm1_MouseDown);

thisResumeLayout(false);

}

public SystemWindowsFormsTimer timer1;

public SystemWindowsFormsImageList imageList1;

}

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

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

华为的爱心代码是:

1、打开要发送的好友聊天窗,点击表情符号。

2、找到拥抱和玫瑰的表情位置。

3、分别按顺序输入13个拥抱、4个玫瑰、2个拥抱、4个玫瑰、1个拥抱、24个玫瑰、1个拥抱、10个玫瑰、3个拥抱、8个玫瑰、5个拥抱、6个玫瑰、7个拥抱、4个玫瑰、9个拥抱、2个玫瑰、17个拥抱,然后发送。

4、最后发送出去就看到用拥抱和玫瑰的表情发出心形了

程序:

var

i,k,x:longint;

begin

for i:=1000 to 9999 do//枚举所有的四位数,因为玫瑰花数一定是四位数

  begin

    k:=0;

    x:=i;

    while x>0 do

      begin

        k:=k+sqr(sqr(x mod 10));//这里可能太快了。这样子,设n表示目前x的各位,则n的四次方为nnnn,而sqr为求平方数,所以sqr(sqr(n))=sqr(nn)=nnnm。将结果累加到k上比较

        x:=x div 10;//截去当前的个位

      end;//以上为求该数每一位数字4次方之和,扫描就是从个位到千位的顺序

    if k=i then writeln(i);//相等就输出

  end;

end

输出应该是这样,不懂再追问

            int one = 0;        //个位

            int ten = 0;        //十位

            int hundred = 0;    //百位

            int thousand = 0;   //千位

            for (int i = 1000; i <= 9999; ++i)

            {

                one = i % 10;           //获取个位

                ten = i / 10 % 10;      //获取十位

                hundred = i / 100 % 10; //获取百位

                thousand = i / 1000;    //获取千位

                //如果等于他本身

                if (MathPow(one, 4) + MathPow(ten, 4) + MathPow(hundred, 4) + MathPow(thousand, 4) == i)

                {

                    //就输出

                    ConsoleWriteLine(i);

                }

            }

以上就是关于C#写的全屏玫瑰的程序源码,名称是loverose 可以运行的,全部的内容,包括:C#写的全屏玫瑰的程序源码,名称是loverose 可以运行的,、求大神帮忙用*打印出一朵玫瑰,或者代码都行(JAVA)、华为的爱心代码是什么等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/10130718.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存