![](https://img-blog.csdnimg.cn/2021040715225520.png)
![](https://img-blog.csdnimg.cn/20210407152300566.png)
![](https://img-blog.csdnimg.cn/20210407152305380.png)
![](https://img-blog.csdnimg.cn/20210407152309687.png)
![](https://img-blog.csdnimg.cn/20210407152315573.png)
import java.io.*;
import java.util.StringTokenizer;
enum Text {
BLANKLINE,
PARAGRAPH,
PROJECT;
}
public class Main {
private static int countParagraph(StringBuilder paragraph, int w) {
int ans = 0;
for (int i = 0; i < paragraph.length();) {
ans++;
if (i + w <= paragraph.length()) {
i += w;
}
else {
break;
}
while (i < paragraph.length() && paragraph.charAt(i) == ' ') {
i++;
}
}
return ans;
}
private static int countProject(StringBuilder project, int w) {
if (project.length() == 0)