| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1866 人关注过本帖
标题:JAVA每日一题(1)
只看楼主 加入收藏
wy19860426
Rank: 2
等 级:论坛游民
帖 子:31
专家分:29
注 册:2010-3-30
收藏
得分:0 
public class ChengFa {
    public static void main(String[] args) {
        for(int i=1;i<=9;i++){
            for(int j=1;j<=i;j++){
                System.out.print(i+"*"+j+"="+(i*j)+" ");
                if(i==j){
                    System.out.println();
                }
            }
        }
    }
}
2010-06-25 00:48
yjsa
Rank: 1
等 级:新手上路
帖 子:9
专家分:3
注 册:2010-4-17
收藏
得分:0 
程序代码:
//九九乘法表
public class Cf
{
  public static void main(String[]args)
  {
   for(int i=1;i<10;i++)
   {
    for(int j=1;j<10;j++)
    {
     int k=i*j;
     System.out.print(i+"*"+j+"="+k+" ");
    }
    System.out.println();
   }


 }

}
2010-06-27 17:34
珊瑚背
Rank: 2
等 级:论坛游民
威 望:1
帖 子:8
专家分:21
注 册:2010-6-27
收藏
得分:0 
程序代码:
class MultTable {
  public static void print(byte m) {
    for(byte b = 1; b <= m; b++) {
      for(byte a = 1; a <= b; a++)
        System.out.print(b + "*" + a + "=" + b*a +" ");
      System.out.println();
    }  //for end.
  } 
}  //class MultTable end.

public class MyClass {
  public static void main(String[] args) {
    byte max =9;
    MultTable.print(max);    //输出1*1 到 max*max 的乘法表
  }
}
2010-06-28 14:01
bj5880415
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-4-1
收藏
得分:0 
public class K
public class static void main(String[] args){
int i,j;
for(i=0;i<10;i++)
{
for(j=0;j<=i;j++)
System.out.print(i+"*"+j+"="+i*j+"  ")  

}
System.out.println();    //在打印第一行之后换行
  


}
2010-07-03 10:57
iop_007
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-7-2
收藏
得分:0 
public class MultiplicationTable{
    public static void main(String args[]){
        for(int i =1;i <=9;i ++){
            for(int j =1;j <= i;j ++){
                String str = j + "*" + i + "=" + j * i;
                System.out.print(str + "\t);
            }
            System.out.println();
         }
     }
}

2010-07-05 12:33
iop_007
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-7-2
收藏
得分:0 
修改:System.out.print(str + "\t");
2010-07-05 12:38
快速回复:JAVA每日一题(1)
数据加载中...
 
   



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

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