欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

java制作五環(huán)代碼 java 環(huán)形數(shù)組

用java寫奧運(yùn)五環(huán)。

設(shè)奧運(yùn)5環(huán)為5個(gè)對(duì)象:A,B,C,D,E

創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)由有經(jīng)驗(yàn)的網(wǎng)站設(shè)計(jì)師、開發(fā)人員和項(xiàng)目經(jīng)理組成的專業(yè)建站團(tuán)隊(duì),負(fù)責(zé)網(wǎng)站視覺設(shè)計(jì)、用戶體驗(yàn)優(yōu)化、交互設(shè)計(jì)和前端開發(fā)等方面的工作,以確保網(wǎng)站外觀精美、成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)易于使用并且具有良好的響應(yīng)性。

則java程序如下:

ListInteger?a=new?ArrayListInteger(9);

ListInteger?b=new?ArrayListInteger();

ListInteger?c=new?ArrayListInteger();

ListInteger?d=new?ArrayListInteger();

ListInteger?e=new?ArrayListInteger();

ListInteger?reslist?=Arrays.asList(new?Integer[]?{1,2,3,4});

ListInteger?res1list?=Arrays.asList(new?Integer[]?{8,7,6,5});

b.add(reslist.get(0)).add(res1list.get(0));

c.add(reslist.get(1)).add(res1list.get(1));

d.add(reslist.get(2)).add(res1list.get(2));

e.add(reslist.get(3)).add(res1list.get(3));

java怎么繪制五環(huán)圖案?

五環(huán)圖片,其關(guān)鍵點(diǎn)是確定五個(gè)圓的中心點(diǎn),只要確定了中心點(diǎn),畫圓就簡(jiǎn)單了,這個(gè)需要你計(jì)算了,可以先用筆在紙上畫一畫,想想思路,祝你成功

求計(jì)算機(jī)高人,要求JAVA的。。謝謝了! 繪圖的題目不用了

//所有題的答案

1.

import java.util.Random;

public class Test33 {

public static void main(String[] args) {

Random rand = new Random();

int a, b, c;

int max, min;

a = rand.nextInt();

b = rand.nextInt();

c = rand.nextInt();

max = ab?(ac?a:c):(bc?b:c);

min = ab?(ac?a:c):(bc?b:c);

System.out.printf("三個(gè)整數(shù):%d, %d, %d\n", a, b, c);

System.out.printf("最大數(shù):%d\n", max);

System.out.printf("最小數(shù):%d\n", min);

}

}

2.

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

int num;

int sum = 0; //和

double avg; //平均數(shù)

int count = 0;

Scanner scan = new Scanner(System.in);

System.out.println("請(qǐng)輸入整數(shù)(-1結(jié)束):");

while(true){

System.out.printf("No. %d:", count+1);

num = scan.nextInt();

if(num==-1){

break;

}

if(num1 || num100){

continue;

}

if(!(num%3==0 num%5!=0 num%9!=0)){

continue;

}

sum += num;

count++;

}

avg = 1.0 * sum / count;

System.out.printf("所有數(shù)的和:%d\n", sum);

System.out.printf("所有數(shù)的平均值:%.2f\n", avg);

}

}

3.

public class Test33 {

public static void main(String[] args) {

int num;

int count = 0;

int i, j;

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

for(j=0; j=9; j++){

num = 10023 + 1000 * i + 100 * j;

if(num%57==0 || num%67==0){

System.out.printf("第%2d種可能 : %d\n", ++count, num);

}

}

}

}

4.

/

5.

public class Test33 {

public static void main(String[] args) {

int num;

int count = 0;

System.out.println("100以內(nèi)的所有素?cái)?shù):");

for(num=2; num=100; num++){

if(isPrime(num) == true){

count++;

System.out.printf("%6d", num);

}

}

System.out.println("\n素?cái)?shù)總數(shù):" + count);

}

public static boolean isPrime(int num){

int i, k;

if(num == 2){

return true;

}

k = (int)Math.sqrt(num);

for(i=2; i=k; i++){

if(num%i == 0){

return false;

}

}

return true;

}

}

6.

public class Test33 {

public static void main(String[] args) {

int total = 100;

int num1; //一分硬幣數(shù)

int num2; //二分硬幣數(shù)

int num5; //五分硬幣數(shù)

int count = 0; //換法總數(shù)

for(num1=1; num1=total; num1++){

for(num2=1; num2=total/2; num2++){

for(num5=1; num5=total/5; num5++){

if(num1+2*num2+5*num5 == total){

count++;

System.out.printf("換法%-3d:一分硬幣數(shù):%2d,二分硬幣數(shù):%2d,五分硬幣數(shù):%2d\n", count, num1, num2, num5);

}

}

}

}

System.out.println("共有" + count + "種換法");

}

}

7.

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

int n;

Scanner scan = new Scanner(System.in);

System.out.print("輸入數(shù)列的大小(n):");

n = scan.nextInt();

System.out.println("Fibonacci數(shù)列");

for(int i=1; in; i++){

System.out.print(fabonacci(i) + ", ");

}

System.out.print(fabonacci(n));

}

public static long fabonacci(int num){

if(num==1 || num==2){

return 1;

}

return fabonacci(num-1) + fabonacci(num-2);

}

}

8.

public class Test33 {

public static void main(String[] args) {

int num;

int a, b, c;

System.out.println("滿足條件的所有三位自然數(shù):");

for(num=100; num1000; num++){

a = num/100;

b = num/10%10;

c = num%10;

if(a*a*a+b*b*b+c*c*c == num){

System.out.println(num);

}

}

}

}

9.

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

int n;

long sum;

Scanner scan = new Scanner(System.in);

System.out.print("輸入正整數(shù)(n):");

n = scan.nextInt();

sum = summary(n);

System.out.printf("1!+2!+...+%d! = %d\n", n, sum);

}

public static long fact(int num){

long f = 1;

for(int i=2; i=num; i++){

f *= i;

}

return f;

}

public static long summary(int num){

long sum = 0;

for(int i=1; i=num; i++){

sum += fact(i);

}

return sum;

}

}

10.

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

double a, b, c;

double x1, x2;

double delta;

Scanner scan = new Scanner(System.in);

System.out.print("a = ");

a = scan.nextDouble();

System.out.print("b = ");

b = scan.nextDouble();

System.out.print("c = ");

c = scan.nextDouble();

delta = b*b-4*a*c;

if(a == 0){

if(b == 0){

System.out.println("一元一次方程無解!");

}

else{

System.out.printf("一元一次方程 x = %.4f\n", 1.0 * c / b);

}

}

else {

if(delta 0){

System.out.println("一元二次方程無實(shí)根!");

}

else if(delta == 0){

x1 = -1.0 * b / (2*a);

System.out.printf("一元二次方程有兩個(gè)相等實(shí)根 x1 = x2 = %.4f\n", x1);

}

else{

x1 = (-1.0 * b + Math.sqrt(delta)) / (2*a);

x2 = (-1.0 * b - Math.sqrt(delta)) / (2*a);

System.out.printf("一元二次方程有兩個(gè)不同的實(shí)根 x1 = %.4f, x2 = %.4f\n", x1, x2);

}

}

}

}

11.

public class Test33 {

public static void main(String[] args) {

int a, b, c;

int num;

int count = 0;

for(a=1; a=4; a++){

for(b=1; b=4; b++){

for(c=1; c=4; c++){

num = 100*a + 10*b + c;

count++;

System.out.printf("%4d", num);

if(count%10==0){

System.out.println();

}

}

}

}

System.out.println("\n共有無重復(fù)的三位數(shù) " + count + " 個(gè)");

}

}

12.

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

int n;

int sign = 1;

int sum = 0;

Scanner scan = new Scanner(System.in);

while(true){

System.out.print("輸入奇數(shù)(n):");

n = scan.nextInt();

if(n0 n%2==1){

break;

}

}

for(int i=1; i=n; i+=2){

sum += sign * i;

sign *= -1;

}

System.out.println("1-3+5-7+...+n = " + sum);

}

}

13.

import java.util.Random;

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

//利用隨機(jī)數(shù)生成一個(gè)包含n(n50)個(gè)二位整數(shù)的數(shù)組,二位整數(shù)的數(shù)組的數(shù)值在[10,60],輸出數(shù)組。

//并求出最大數(shù)和最小數(shù),并顯示出結(jié)果。

int i, n;

int[] arr;

int max, min;

Random rand = new Random();

Scanner scan = new Scanner(System.in);

while(true){

System.out.print("輸入數(shù)組大小(0n50):");

n = scan.nextInt();

if(n0 n50){

break;

}

}

arr = new int[n];

for(i=1; in; i++){

arr[i] = rand.nextInt(60);

if(arr[i] 10){

arr[i] += 10;

}

}

max = min = arr[0];

for(i=1; in; i++){

if(arr[i] max){

max = arr[i];

}

else if(arr[i] min){

min = arr[i];

}

}

System.out.println("所有二位整數(shù):");

for(i=1; i=n; i++){

System.out.printf("%3d", arr[i-1]);

if(i%10==0){

System.out.println();

}

}

System.out.printf("\n最大數(shù):%d,最小數(shù):%d\n", max, min);

}

}

14.

import java.util.Scanner;

public class Test33 {

public static void main(String[] args) {

int i, n;

int f1=1, f2=2;

double sum = 0;

Scanner scan = new Scanner(System.in);

while(true){

System.out.print("輸入數(shù)列的前n項(xiàng)(n0):");

n = scan.nextInt();

if(n0){

break;

}

}

for(i=1; i=n; i++){

sum += 1.0 * f2 / f1;

f2 = f1 + f2;

f1 = f2 - f1;

}

System.out.printf("數(shù)列前%d項(xiàng)的和 = %.4f\n", n, sum);

}

}

15.

public class Test33 {

public static void main(String[] args) {

int total = 100; //總金額

int cock; //公雞數(shù)

int hen; //母雞數(shù)

int chicken; //小雞數(shù)

int count = 0; //方案總數(shù)

for(cock=0; cock=total/5; cock++){

for(hen=0; hen=total/3; hen++){

for(chicken=0; chicken=total*3; chicken++){

if(cock*5+hen*3+chicken/3.0 == total){

System.out.printf("方案%-3d\t公雞:%2d只,母雞: %2d只,小雞: %2d只\n", ++count, cock, hen, chicken);

}

}

}

}

System.out.println("共有" + count + "種購買方案");

}

}

16.

public class Test33 {

public static void main(String[] args) {

int i, num, sum;

System.out.println("1000以內(nèi)所有完數(shù):");

for(num=1; num=1000; num++){

for(sum=1,i=2; i=num/2; i++){

if(num%i == 0){

sum += i;

}

}

if(sum == num){

System.out.println(num);

}

}

}

}

17.

public class Test33 {

public static void main(String[] args) {

int total = 1000;

int a, b, c; //單價(jià)分別為50、40、30元的3種商品的數(shù)量

int count = 0; //購買方案總數(shù)

System.out.println("所有的購買方案:");

for(a=1; a=total/50; a++){

for(b=1; b=total/40; b++){

for(c=1; c=total/30; c++){

if(a+b+c==30 50*a+40*b+30*c==total){

System.out.printf("購買方案%2d:50元商品 %2d件,40元商品 %2d件,30元商品 %2d件\n", ++count, a, b, c);

}

}

}

}

System.out.printf("購買方案總數(shù)%2d\n", count);

}

}

18.

/

19.

/

20.

public class Test33 {

public static void main(String[] args) {

int num;

int count = 0;

System.out.println("所有滿足條件的5位數(shù):");

for(num=10000; num100000; num++){

if(num%10==6 num%3==0) {

System.out.printf("No.%5d:%d\n", ++count, num);

}

}

System.out.printf("這樣的5位數(shù)共有:%d\n", count);

}

}

21.

public class Test33 {

public static void main(String[] args) {

int total;

for(total=1; ;total++){

if(total%2==1 total%3==2 total%5==4 total%6==5 total%7==0){

break;

}

}

System.out.println("這條階梯最少共有" + total + "階");

}

}

22.

public class Test33 {

public static void main(String[] args) {

int num;

int a, b, c, d; //千、百、十、個(gè)位數(shù)

int m;

for(num=1000; num10000; num++){

a = num/1000;

b = num/100%10;

c = num/10%10;

d = num%10;

m = (int)Math.sqrt(num);

if(a==b c==d a!=c m*m==num){

System.out.println(num);

}

}

}

}

java怎么繪制五環(huán)圖案

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package 臨時(shí)文件;

import java.awt.*;

import javax.swing.*;

public class test{

public static void main(String[] args) {

MyFrame frame = new MyFrame();

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//1

frame.setSize(500,400); //2

frame.setVisible(true); //3

}

}

class MyFrame extends JFrame

{

public MyFrame()

{

// get screen dimensions

Toolkit kit = Toolkit.getDefaultToolkit();

Dimension screenSize=kit.getScreenSize();

int screenHeight = screenSize.height;

int screenWidth = screenSize.width;

// center frame in screen

setSize(screenHeight/2,screenWidth/2);

setLocation(screenHeight/4,screenWidth/4);

// set frame icon and title

Image img = kit.getImage("icon.gif");

setIconImage(img);

setTitle("myframe");

Container contentPane=getContentPane();

contentPane.add(new DrawRings());

}

}

分享題目:java制作五環(huán)代碼 java 環(huán)形數(shù)組
網(wǎng)頁地址:http://chinadenli.net/article12/dojohdc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)營銷型網(wǎng)站建設(shè)網(wǎng)站設(shè)計(jì)公司服務(wù)器托管面包屑導(dǎo)航品牌網(wǎng)站設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)