查找10以内积为50的两个数。。 求大神来解答。。。
java吧
全部回复
仅看楼主
level 2
8751490100 楼主
= =。。 新手表示不会
2014年09月27日 11点09分 1
level 2
8751490100 楼主
[吐舌]
2014年09月27日 12点09分 2
level 2
8751490100 楼主
[酷]
2014年09月27日 12点09分 3
level 2
8751490100 楼主
[哈哈]
2014年09月27日 12点09分 4
level 6
循环一到十的数字,两两相乘,如果结果等于50就把这两货打印出来
2014年09月27日 12点09分 5
[真棒]
2014年09月27日 12点09分
呵呵加油,还有看到下边说效率问题的新手不要管以后就懂了先做出来再想
2014年09月27日 15点09分
level 6
嘉豪?
2014年09月27日 12点09分 6
level 4
2014年09月27日 12点09分 7
[真棒]
2014年09月27日 12点09分
level 7
public class FuckFifty {
public static void main(String[] args)
{
for(int i=1;i<11;i++)
{
for(int j=1;j<11;j++)
{
if(i*j==50)
{
System.out.println("one is "+i);
System.out.println("otherone is "+j);
}
}
}
}
}
2014年09月27日 12点09分 8
[真棒]
2014年09月27日 12点09分
level 1
public class Dame{
public static void main(String[] args){
for(int i=1; i<=10; i++){
for(int j=1;j<=10;j++){
if(i*j==50){
System.out.println("相乘等于50的两个数是:"+i+"、"+j);
}
}
}
}
}
2014年09月27日 12点09分 9
这么写有重复,做了好多无用计算。
2014年09月28日 16点09分
例如i=5,j=10和i=10,j=5是一样的。
2014年09月28日 16点09分
level 12
不能这么玩吧。10以内有50?
2014年09月27日 13点09分 10
level 9
哎,看不下去了。居然用双重循环,这得多没效率啊。
都定死了是10以内,乘积为50了,还用双重循环[汗]
敲代码敲傻了吧。
2014年09月27日 14点09分 11
level 12
楼上没一个--的
2014年09月27日 14点09分 12
level 9
import java.io.*;
public class Test{
public static void main(String[] args){
for(int i=1;i<=10;i++){
if(50%i==0&&50/i<=10)
System.out.println(i+"and"+50/i);
}
}
}
2014年09月27日 15点09分 13
level 11
额。我默默背了一遍乘法表。。只有7*7最接近啊,难道我错了么?
2014年09月28日 15点09分 14
5*10。
2014年09月28日 16点09分
level 11
你看看咯我只是来送标准的
十五字
2014年09月28日 15点09分 15
level 9
人生是一种选择,亦是一种放弃。能自由选择的人是幸福的,能适度放弃的心是洒脱的。可惜,有时我们的选择,只有等待,没有结果,只能黯然离开;有时我们的放弃,迫于无奈,含泪转身,走远了依旧频频地回望。
2014年09月28日 21点09分 16
1