日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java print int_java – 在printin输入int

發(fā)布時間:2024/4/20 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java print int_java – 在printin输入int 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

我正在嘗試修復我寫的腳本:

import java.util.Scanner;

public class Line2

{

public static void main (String [] args)

{

Scanner scan = new Scanner (System.in);

System.out.println ("Please enter 4 integers");

int x1 = scan.nextInt();

int y1 = scan.nextInt();

int x2 = scan.nextInt ();

int y2 = scan.nextInt ();

double distance;

//Asking the user to insert coordinates of both points and setting double

// on distance in order to properly calculate the square root

distance = Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));

System.out.print( "the length of the line between the points" (int x1,int x2) "and" (int y1,int y2) "is" distance);

//Telling the program to calculate the distance of two points given by user

}//end of method main

}

我試圖讓x1 x2 y1和y2出現(xiàn)在里面,但它不允許我 – 給Y(有點)預期……

無論int是什么,我能做什么才能使它出現(xiàn)? (除了那個程序運行得很好,我認為..)

謝謝

總結(jié)

以上是生活随笔為你收集整理的java print int_java – 在printin输入int的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。