命令提示符是命令行解释程序向您(用户)显示的文本字符串,用于提示您以交互方式输入。对于通常具有文本用户界面的程序,而不是专门针对用户输入的提示,请参阅CONSOLE-APPLICATION(Microsoft Windows)或TERMINAL(Unices,MacOS 10和Linux)标记。有关命令行在命令提示符处调用的命令,请参阅COMMAND-LINE或SuperUser。
打开JAR文件时如何运行Windows命令提示 我是一名初学者Java程序员,拥有大约一周的Java经验,大约三个星期的C#经验。我正在研究我的第一个基本项目,并且将其导出到一个JAR文件中,可以是
import java.util.Scanner; public class Main { public static void main(String[] args) { // Make it automatically open Command prompt float[] inputVariables = new float[4]; calculator(inputVariables); } public static void calculator(float[] loopVariables) { System.out.println("WARNING: Inputting a non true or false value, or a non number when asked to will crash the program! (For now)"); Scanner inputScanner = new Scanner(System.in); while (true) { float z = 0; System.out.println("Select an operation: (Addition: +, Subtraction: -, Multiplication: *, Division: /, Modulo: %, Power: ^, Absolute Value: |, Round: ~"); String operation = inputScanner.next(); switch (operation) { case "+", "-", "*", "/", "%", "^", "|", "~" -> { } default -> { System.out.println("This is not a valid operation."); continue; } } float x; if (loopVariables[1] == 0) { System.out.println("Input x:"); x = inputScanner.nextFloat(); } else { x = loopVariables[0]; System.out.println("x = " + x); } float y = 0; switch (operation) { case "+", "-", "*", "/", "%", "^" -> { System.out.println("Input y:"); y = inputScanner.nextFloat(); } case "~" -> { System.out.println("Round up, down or auto: (+ or -)"); operation = inputScanner.next(); switch (operation) { case "+" -> { System.out.println("+~" + x + " = " + (Math.ceil(x))); z = (float)Math.ceil(x); operation = "~"; } case "-" -> { System.out.println("-~" + x + " = " + (Math.floor(x))); z = (float)(Math.floor(x)); operation = "~"; } default -> { System.out.println("This is not a valid operation."); continue; } } } case "|" -> { } } switch (operation) { case "+" -> { System.out.println(x + " + " + y + " = " + (x + y)); z = x + y; } case "-" -> { System.out.println(x + " - " + y + " = " + (x - y)); z = x - y; } case "*" -> { System.out.println(x + " * " + y + " = " + (x * y)); z = x * y; } case "/" -> { System.out.println(x + " / " + y + " = " + (x / y)); z = x / y; } case "%" -> { System.out.println(x + " % " + y + " = " + (x % y)); z = x % y; } case "^" -> { System.out.println(x + "^" + y + " = " + (float)(Math.pow(x, y))); z = (float)Math.pow(x, y); } case "|" -> { System.out.println("|" + x + "| = " + (Math.abs(x))); z = Math.abs(x); } case "~" -> { } default -> { System.out.println("This is not a valid operation."); continue; } } System.out.println("Would you like to continue with the result as x? (true or false)"); boolean finish = inputScanner.nextBoolean(); float hasLooped; if (finish) { hasLooped = 1; loopVariables[0] = z; loopVariables[1] = hasLooped; continue; } else { System.out.println("Would you like to continue without the result as x? (true or false)"); finish = inputScanner.nextBoolean(); } hasLooped = 0; loopVariables[1] = hasLooped; if (!finish) { System.out.println("Ending Calculator."); break; } } } }
byobu-如何禁用byobu_prompt_runtime
我不想禁用Byobu提示(BYOBU-DISABL-PROMPT),因为我更喜欢Byobu彩色提示。但是,我确实想删除运行时,并返回行为到Ubuntu 22.04和Pr ...
如何使用多行发送多个命令到命令提示符窗口? 我看到如何在一行中做到这一点 启动“ my-scrip” cmd.exe /k“设置提示=($ t)$ p $ g&...
我尝试按照 Windows 10 中的编辑 %PATH% 变量教程,在 Windows 10 中使用命令行编辑 %PATH% 变量,但无法识别 pathman/au。 正确的应用程序应该是什么...
如何在 CMD 中使用延迟扩展和循环时从变量动态打印感叹号?
我一直在尝试打印文件名,其中一些包含“!”在他们的名字里。我当前的输出,它打印不带“!”的文件名。 我尝试启用并
我有一个命令 cf apps 输出: 名称请求状态进程路由 accountdivisioncalculator__pte01__performance__0 开始...
我有一个命令 cf apps 输出 姓名 请求状态头 流程 路线 应用程序名称1 开始了 网 1:1 abc.test.com 应用程序名称2 停止了 网2:1 如何访问名称的所有值,然后循环...
我使用的是Windows XP, 有什么方法可以最大化我的 cmd.exe 窗口吗? 我正在做一些mysql,在这么小的窗口中读取查询结果非常困难。 为什么最大化并不真正
cmd 是我的默认终端,即使在设置中我写了这样的: "terminal.integrated.shell.windows": "C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe", 当我还是你的时候...
我想运行以下代码(在 Ubuntu 中可执行)或其在 Windows 中的等效代码: python3 -m 烧瓶运行 如何在 Windows 中运行上面的代码?当我在命令提示符中写入它时,...
cd 命令有问题。 我尝试过 cd 桌面 它带我到 c:\Users\pekka\Desktop> 在桌面上我有一个文件夹 Summersemester 所以我写了 cd Summersemester,它给出了错误消息 ...
我正在尝试测试我的节点应用程序,并且我有多个测试文件,因此我使用 npm run test -- --test-concurrency=1 标志一次测试一个文件。当我在 Vscode 终端中运行该命令时...
如何通过资源管理器中的右键菜单项使用批处理文件创建文件夹或文件的虚拟副本?
所以,我想右键单击一个文件夹并使用 0 字节文件创建该文件夹的虚拟副本。我使用 robocopy 命令如下: 对于文件夹: Robocopy /创建/清除/S“%cd%”“...
Python - 如何在脚本运行时隐藏 Windows 命令提示符屏幕?
当我的 python 脚本运行时,如何从桌面上删除这个黑色的命令提示符屏幕? 我使用 python 2 exe 将 service.py 脚本制作成 exe。一切正常,但是当 .exe 是
我正在桌面上使用命令提示符中的 echo 创建一个 hello_world.txt,这是我的输入。 echo hello world > C:\Users\user\Desktop\hello_world.txt 第一个代码有效,然后我尝试%
如何在Windows中使用命令提示符查找系统中存在的所有word文件? 我尝试使用 dir \s\o list.docx 但它不起作用。任何人都可以回答这个问题并告诉我们