java吧 关注:1,236,684贴子:12,705,833
  • 0回复贴,共1

求助,小程序哪里出错了呢?

只看楼主收藏回复

improt java.util.*;
class Repeat{pubilc static void main(String[] arguments){String sentence="I'm happy.";int count=0;Calendar start=Calendar.getInstance();int startMinute=start.get(Calendar.MINUTE);int startSecond=start.get(Calendar.SECOND);start.roll(Clendar.MINUTE,true);int nextMinute=start.get(Calendar.MINUTE);int nextMinute=start.get(Calendar.SECOND);while(count<1000000){System.out.println(sentence);GregorianCalendar now=new GregorianCalendar();if(now.get(Calendar.MINUTE)>=nextMinute){if(now.get(Calendar.SECOND)>=nextSecond){break;}}count++;}System.out.println("\nI wrote the sentence"+count+"times.");System.out.println("I have learned my lesson.");}}


1楼2013-04-11 10:49回复