- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
import java.util.*;
public class Main
{
public static void main(String[] args) throws InterruptedException
{
StringBuilder s = new StringBuilder("#");
byte a=1;
boolean t=false;
while(true)
{
if(!t)
{
s.append("#");
a++;
}
if(a==40)
{
t=true;
}
if(a==0)
t=false;
if(t)
{
s.deleteCharAt(s.length()-1);
a--;
}
System.out.println(s);
Thread.sleep(100);
}
}
}