矢溢╮
矢溢╮
关注数: 66
粉丝数: 526
发帖数: 6,260
关注贴吧数: 46
明日方舟干员推荐榜(个人向) 理性讨论 综合评分=0.3*强度评分 + 0.3*日常评分 + 0.2*高难评分 + 0.2*肉鸽评分
来下棋吗 我重装狙
我真是太非了,开服玩到现在300多天了还是没见过高姿 舟游是不是该出个成就系统来补偿一下啊 “叮”连续一年公招没出过高姿达成成就——“非洲战神”
为啥我建不了呢? 我电力是满的啊?
大神们 这个黑边是怎么回事 有大神指导一下吗?
小米mix2s的免打扰模式在哪设置啊?我每晚一点就自动开了 小米mix2s的免打扰模式在哪设置啊? 我每晚一点就自动开了 有时候没关夜间有电话都接不到
大神们 让写求100个随机形状的面积之和 我这个哪里出问题了? import java.util.*; import java.lang.Math; public class Test{ public static void main(String args[]){ double sump=0; double sumarea=0; for(int n=0;n<100;n++){ int i=(int)Math.random()*4; switch(i){ case 0:Shape[i]=new Circle(); case 1:Shape[i]=new Rectangle(); case 2:Shape[i]=new Square(); case 3:Shape[i]=new Lade();break; } sump+=Shape[i].getPerimeter(); sumarea+=Shape[i].getArea(); } System.out.println("这100个形状的周长和为"+sump); System.out.println("这100个形状的面积和为"+sumarea); } } abstract class Shape{ public abstract double getArea(); public abstract double getPerimeter(); } class Circle extends Shape{ double radius=Math.random()*50 + 1; public double getArea(){ double area; area=Math.PI*radius*radius; return area; } public double getPerimeter(){ double p; p=Math.PI*radius*2.0; return p; } } class Rectangle extends Shape{ double height=Math.random()*100 + 1; double length=Math.random()*100 + 1; public double getArea(){ double area; area=height*length; return area; } public double getPerimeter(){ double p; p=(height+length)*2.0; return p; } } class Square extends Rectangle{ double length=Math.random()*100 + 1; public double getArea(){ double area; area=length*length; return area; } public double getPerimeter(){ double p; p=length*4.0; return p; } } class Lade extends Shape{ double above=Math.random()*100 + 1; double bottom=Math.random()*100 + 1; double height=Math.random()*100 + 1; public double getArea(){ double area; area=height*(above+bottom)/2.0; return area; } public double getPerimeter(){ double p; double v2=sqrt(Math.pow((bottom-above),2)+4.0*Math.pow(height,2)); p=v2+above+bottom; return p; } }
极限闪避流 无伤过神秘人
极限闪避流 全程不掉一滴血 无伤过神秘人
有人喜欢玩BC吗 做地图的那种
小白问一个问题! 我看到有些大神是用画笔直接画出图像,那个是怎么画的
为啥我的机械师都没事干呢?怎么让他们忙起来
这号还有的救吗
这个为什么设置不了呢 队列设置无效
密码忘记了怎么办
没想到以这样的方式离开少三? 这个平台已经快3小时连不上去了 公司倒闭了那还玩个毛线?
1
下一页