HW6.29
2024-10-01 12:29:32
public class Solution { public static void main(String[] args) { int count = 0; int[] card = new int[4]; int sum = 0; while(true) { sum = 0; for(int i = 0; i < 4; i++) card[i] = (int)(Math.random() * 13 + 1); count++; for(int i: card) sum += i; if(sum == 24) break; } System.out.println("It has run " + count + " times"); } }
最新文章
- JAVA 链表操作:循环链表
- HDU1215(筛选法)
- How to relocate tablespace directory
- 重构第14天 分离职责(Break Responsibilities)
- iOS边练边学--Http网络再学习,简单介绍
- Swift—类型检查与转换-备
- 01js高级_1
- js中运动框架的封装
- Java 第八周总结
- C#实现断点续传
- 转 Java虚拟机5:Java垃圾回收(GC)机制详解
- PHP7.1安装xdebug
- 安装Prometheus-Opeartor
- python 文件描述符
- centos FTP 用户指定目录禁用上级目录
- Office2013中文激活版
- sqlserver实现分页的几种方式
- C# 很少人知道的科技
- python3 爬虫相关-requests和BeautifulSoup
- io.fabric8.kubernetes对pv和pvc的增删查改