一道算法题,N个线程,顺序打印M个数字(踩坑点) – billy wan‘s blogs
题目:
N个线程,顺序打印M个数字
例如:4个线程,14个数字。
效果:
Thread-0-0
Thread-1-1
Thread-2-2
Thread-3-3
Thread-0-4
Thread-1-5
Thread-2-6
Thread-3-7
Thread-0-8
Thread-1-9
Thread-2-10
Thread-3-11
Thread-0-12
Thread-1-13
代码段:
import java.util.*;
import...
原创
2022-01-24 09:11:38 ·
534 阅读 ·
0 评论