| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 722 人关注过本帖
标题:帮忙看下,谢谢
取消只看楼主 加入收藏
anhuizxw
Rank: 1
等 级:新手上路
帖 子:17
专家分:6
注 册:2009-7-12
结帖率:83.33%
收藏
已结贴  问题点数:20 回复次数:0 
帮忙看下,谢谢
import java.util.*;

public class Demo
{
    public static void main(String[] args )
    {
        
        GregorianCalendar d=new GregorianCalendar();
        
        int today=d.get(Calendar.DAY_OF_MONTH);
        
        int month=d.get(Calendar.MONTH);
        
        d.set(Calendar.DAY_OF_MONTH,1);
        
        int weekday=d.get(Calendar.DAY_OF_MONTH);
        
        System.out.println("Sun Mon Tue Wed Thu Fri Sat");
        
        for(int i=Calendar.SUNDAY;i<weekday;i++)
        
        System.out.print("    ");
        
        do
        {
            
            int day=d.get(Calendar.DAY_OF_MONTH);
            
            System.out.printf("%3d",day);
            
            if(day==today)
            
            System.out.print("*");
            
            else
            
            System.out.print(" ");
            
            if(weekday==Calendar.SATURDAY)
            
            System.out.println();
            
            d.add(Calendar.DAY_OF_MONTH,1);
            
            weekday=d.get(Calendar.DAY_OF_MONTH);
            
        }
        while(d.get(Calendar.MONTH)==month);
        
        if(weekday!=Calendar.SUNDAY)
        
        System.out.println();
        
    }
}
不知道问题出在哪里,请帮帮忙!
搜索更多相关主题的帖子: public import 
2009-11-25 14:24
快速回复:帮忙看下,谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040226 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved