永发信息网

帮忙写一个Java call method程序 具体要求如下 在线等!!!!

答案:4  悬赏:20  手机版
解决时间 2021-03-11 12:38
  • 提问者网友:凉末
  • 2021-03-10 15:28
要求用这个方程f(x)=x*x-16

然后运行程序后出来的output要求是
1 -15
2 -12
3 -7
4 0
5 9
·········
10 84
最佳答案
  • 五星知识达人网友:鸽屿
  • 2021-03-10 15:58
public class Test{

public static void main(String[] args) {
// TODO Auto-generated method stub
call(10);
}
public static void call(int num){
for(int i=1;i<=num;i++){
System.out.println(i+" "+(i*i-16));
}
}
}
全部回答
  • 1楼网友:逐風
  • 2021-03-10 19:01
public class client { public static void main(String[] args) { System.out.println(call(1)); } private static int call(int x) { return x * x -16; } }
  • 2楼网友:你可爱的野爹
  • 2021-03-10 17:58
package baidu; public class call { public static void main(String[] args) { // TODO Auto-generated method stub call(10); } public static void call(int num){ for(int i=0;i<=num;i++){ System.out.println(i+"\t"+(i*i-16)); } } }
  • 3楼网友:醉吻情书
  • 2021-03-10 17:37
换一下jdbc连接库试试,换成sqlserver 2000版本的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯