microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.95k stars 28.77k forks source link

PointSumAve #128377

Closed hiroshi-nakajima345 closed 3 years ago

hiroshi-nakajima345 commented 3 years ago

必要import java.util.Scanner;

class PointSumAve {

public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int sum = 0;        // 合計
    System.out.println("5人の点数を入力せよ。");

    System.out.print("1番の点数:");
    int yamane = stdIn.nextInt();
    sum += yamane;

    System.out.print("2番の点数:");
    int takada = stdIn.nextInt();
    sum += takada;

    System.out.print("3番の点数:");
    int kawachi = stdIn.nextInt();
    sum += kawachi;

    System.out.print("4番の点数:");
    int koga = stdIn.nextInt();
    sum += koga;

    System.out.print("5番の点数:");
    int tozuka = stdIn.nextInt();
    sum += tozuka;

    System.out.println("合計は" + sum + "点です。");
    System.out.println("平均は" + (double)sum / 5 + "点です。");
}

} なデータが送信するには大きすぎたため、クリップボードに書き込みました。貼り付けてください。

hiroshi-nakajima345 commented 3 years ago

By Eclipse. this code can go well.

hiroshi-nakajima345 commented 3 years ago

(1)Main.code import java.util.Scanner;

class PointSumAve {

public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int sum = 0;        // 合計
    System.out.println("5人の点数を入力せよ。");

    System.out.print("1番の点数:");
    int yamane = stdIn.nextInt();
    sum += yamane;

    System.out.print("2番の点数:");
    int takada = stdIn.nextInt();
    sum += takada;

    System.out.print("3番の点数:");
    int kawachi = stdIn.nextInt();
    sum += kawachi;

    System.out.print("4番の点数:");
    int koga = stdIn.nextInt();
    sum += koga;

    System.out.print("5番の点数:");
    int tozuka = stdIn.nextInt();
    sum += tozuka;

    System.out.println("合計は" + sum + "点です。");
    System.out.println("平均は" + (double)sum / 5 + "点です。");
}

} (2) question1. "stdin " is prvented by leak. Is there any way to void to leak. Eclipse can do this code success. why VSC can not success. tere is no use to "scanner close();" question2. Why is this code non project.file? Eclipse can do this code success

pointed out by VSC { "resource": "/C:/Users/HIROSHI/Downloads/MeikaiJava2nd_Source/chap06/PointSumAve.java", "owner": "_generated_diagnostic_collection_name_#1", "code": "16", "severity": 4, "message": "PointSumAve.java is a non-project file, only syntax errors are reported", "source": "Java", "startLineNumber": 1, "startColumn": 1, "endLineNumber": 1, "endColumn": 2 } ----- 元のメッセージ ----- From: "VS Code Issue Triage Bot" ***@***.***> 宛先: "microsoft/vscode" ***@***.***> Cc: "hiroshi-nakajima345" ***@***.***>, "State change" ***@***.***> 送信済み: 2021年07月10日 午後 8:04 件名: Re: [microsoft/vscode] PointSumAve (#128377) >  この問題を作成してくれてありがとう!しかし、説明は英語ではないため、私たちはそれに取り組むのが難しいです。もし、可能であれば、英語で行くように編集してください。新しいコメントを追加したり、新しい懸案事項を作成したりするのではなく、既存の懸案事項を編集してください。残念ながら、自動翻訳サービスはソフトウェアの問題について効果的にコミュニケーションを取るために必要な技術言語を扱うことはできないので、翻訳を支援する技術に精通している人の翻訳者を見つけることをお勧めします。それ以外の場合、この問題は翻訳が必要であるとマークされており、コミュニティメンバーが翻訳を支援できる場合があります。Thanks for creating this issue!Unfortunately, as the description is not in English, it's hard for us to work on. If possible, please edit the original issue to be in English.In our experience, automatic translation services are not able to handle the technical language needed to effectively communicate about software issues, so we recommend finding a human translator who is familiar with our technology to help.Otherwise, we have marked this as needing translation and a community member may be able to help out.—You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub, or unsubscribe.
hiroshi-nakajima345 commented 3 years ago

(1)twiter.copy

import java.util.Random; import java.util.Scanner; main.code class IntArrayRand { public static void main(String[] args) { Random rand = new Random(); Scanner stdIn = new Scanner(System.in); System.out.print("要素数:"); int n = stdIn.nextInt(); // 要素数を読み込む int[] a = new int[n]; // 配列を生成 for (int i = 0; i < n; i++) a[i] = 1 + rand.nextInt(10); // 1~10の乱数 for (int i = 0; i < n; i++) { System.out.print("a[" + i + "] : "); for (int j = 0; j < a[i]; j++) System.out.print('*'); System.out.println(); } } } //これもSTDIN,leakで動かずですか、eclipseではきちんと動きますよ added part ①in this code enveloped "stdin" by this reason happend" leak" by eclipse this code work,well ②Does this code fall in "non project file"? Why? I am sorry to send new cace by this mail. ----- 元のメッセージ ----- From: "VS Code Issue Triage Bot" ***@***.***> 宛先: "microsoft/vscode" ***@***.***> Cc: "hiroshi-nakajima345" ***@***.***>, "State change" ***@***.***> 送信済み: 2021年07月10日 午後 8:04 件名: Re: [microsoft/vscode] PointSumAve (#128377) >  この問題を作成してくれてありがとう!しかし、説明は英語ではないため、私たちはそれに取り組むのが難しいです。もし、可能であれば、英語で行くように編集してください。新しいコメントを追加したり、新しい懸案事項を作成したりするのではなく、既存の懸案事項を編集してください。残念ながら、自動翻訳サービスはソフトウェアの問題について効果的にコミュニケーションを取るために必要な技術言語を扱うことはできないので、翻訳を支援する技術に精通している人の翻訳者を見つけることをお勧めします。それ以外の場合、この問題は翻訳が必要であるとマークされており、コミュニティメンバーが翻訳を支援できる場合があります。Thanks for creating this issue!Unfortunately, as the description is not in English, it's hard for us to work on. If possible, please edit the original issue to be in English.In our experience, automatic translation services are not able to handle the technical language needed to effectively communicate about software issues, so we recommend finding a human translator who is familiar with our technology to help.Otherwise, we have marked this as needing translation and a community member may be able to help out.—You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub, or unsubscribe.
hiroshi-nakajima345 commented 3 years ago

(1)added bug occured.

is like under: *一部日本語になっています。英語等への変換はわたくしには難しく、スタッフの方のご援助をお願いいたします。 なお、https://github.com/lzybkr/PSReadLine/issues/new。に掲載を試みましたので、内容が重複したかもしれません。ご容赦ください。 ①part of report is consist of English. it iis difficult to translate in English.please help me by your staff. ②if possible teach me how to exchange code contents int max = tensu[0]; >> >> for (int i = 1; i < tensu.length; i++) >> >> if (tensu[i] > max) max = tensu[i]; >> >> >> >> System.out.println("最高点は" + max + "点です。"); >> 問題が発生しました。このバグを以下の詳細と共に報告してください。 >> GitHub で報告: https://github.com/lzybkr/PSReadLine/issues/new >> ----------------------------------------------------------------------- >> 直前 200 個のキー: >> s u [ i ] Space = Space s c a n n e r . n e x t I n t ( ) ; Tab Tab / / Space t e n s u [ i ] を 読 み 込 む Enter >> Tab Tab } Enter >> Enter >> Tab Tab i n t Space m a x Space = Space t e n s u [ 0 ] ; Enter >> Tab Tab f o r Space ( i n t Space i Space = Space 1 ; Space i Space < Space t e n s u . l e n g t h ; Space i + + ) Enter >> Tab Tab Tab i f Space ( t e n s u [ i ] Space > Space m a x ) Space m a x Space = Space t e n s u [ i ] ; Enter >> Enter >> Tab Tab S y s t e m . o u t . p r i n t l n ( " 最 高 点 は " Space + Space m a x Space + Space " 点 で す 。 " ) ; Enter >> Tab } >> >> 例外: >> System.ArgumentOutOfRangeException: 値には 0 以上で、コンソールの次元のバッファー サイズ未満を指定しなければなりません。 >> パラメーター名:top >> 実際の値は -4 です。 >> 場所 System.Console.SetCursorPosition(Int32 left, Int32 top) >> 場所 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor) >> 場所 Microsoft.PowerShell.PSConsoleReadLine.ForceRender() >> 場所 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c) >> 場所 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg) >> 場所 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg) >> 場所 Microsoft.PowerShell.PSConsoleReadLine.InputLoop() >> 場所 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics) >> ----------------------------------------------------------------------- >> PS C:\Users\HIROSHI> public static void main(String[] args) { >> >> Scanner scanner = new Scanner(System.in); >> >> final int NUMBER = 5;// 人数 >> >> int[] tensu = new int[NUMBER];// 点数 >> >> >> >> System.out.println(NUMBER + "人の点数を入力せよ。"); >> >> for (int i = 0; i < NUMBER; i++) { >> >> System.out.print((i + 1) + "番の点数:"); >> >> tensu[i] = scanner.nextInt();// tensu[i]を読み込む >> >> } >> >> >> >> int max = tensu[0]; >> >> for (int i = 1; i < tensu.length; i++) >> >> if (tensu[i] > max) max = tensu[i]; >> >> >> >> System.out.println("最高点は" + max + "点です。 ----------------------------------------------------------------------- ----- 元のメッセージ ----- From: "VS Code Issue Triage Bot" ***@***.***> 宛先: "microsoft/vscode" ***@***.***> Cc: "hiroshi-nakajima345" ***@***.***>, "State change" ***@***.***> 送信済み: 2021年07月10日 午後 8:04 件名: Re: [microsoft/vscode] PointSumAve (#128377) >  この問題を作成してくれてありがとう!しかし、説明は英語ではないため、私たちはそれに取り組むのが難しいです。もし、可能であれば、英語で行くように編集してください。新しいコメントを追加したり、新しい懸案事項を作成したりするのではなく、既存の懸案事項を編集してください。残念ながら、自動翻訳サービスはソフトウェアの問題について効果的にコミュニケーションを取るために必要な技術言語を扱うことはできないので、翻訳を支援する技術に精通している人の翻訳者を見つけることをお勧めします。それ以外の場合、この問題は翻訳が必要であるとマークされており、コミュニティメンバーが翻訳を支援できる場合があります。Thanks for creating this issue!Unfortunately, as the description is not in English, it's hard for us to work on. If possible, please edit the original issue to be in English.In our experience, automatic translation services are not able to handle the technical language needed to effectively communicate about software issues, so we recommend finding a human translator who is familiar with our technology to help.Otherwise, we have marked this as needing translation and a community member may be able to help out.—You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub, or unsubscribe.