加法变乘法
我们都知道:1+2+3+ ... + 49 = 1225
现在要求你把其中两个不相邻的加号变成乘号,使得结果为2015
比如:
1+2+3+...+10*11+12+...+27*28+29+...+49 = 2015
就是符合要求的答案。
请你寻找另外一个可能的答案,并把位置靠前的那个乘号左边的数字提交(对于示例,就是提交10)。
注意:需要你提交的是一个整数,不要填写任何多余的内容。
16
/**
* Created by m1786 on 2017/3/7.
*/
public class 加法变乘法 {
public static void main(String args[]){
for(int i=1;i<30;i++)
for(int k=i+1;k<30;k++)
if(1225-2*i-2*k-2+i*(i+1)+k*(k+1)==2015){
System.out.println(i+" "+k);
}
}
}
我们都知道:1+2+3+ ... + 49 = 1225
现在要求你把其中两个不相邻的加号变成乘号,使得结果为2015
比如:
1+2+3+...+10*11+12+...+27*28+29+...+49 = 2015
就是符合要求的答案。
请你寻找另外一个可能的答案,并把位置靠前的那个乘号左边的数字提交(对于示例,就是提交10)。
注意:需要你提交的是一个整数,不要填写任何多余的内容。
16
/**
* Created by m1786 on 2017/3/7.
*/
public class 加法变乘法 {
public static void main(String args[]){
for(int i=1;i<30;i++)
for(int k=i+1;k<30;k++)
if(1225-2*i-2*k-2+i*(i+1)+k*(k+1)==2015){
System.out.println(i+" "+k);
}
}
}
398

被折叠的 条评论
为什么被折叠?



