我正在编写一个函数,我希望它返回两个整数作为结果。但是,我无法让它做到这一点。有人可以帮助我吗?这是我最好的镜头
public static int calc (int s, int b, int c, int d, int g)
{
if (s==g)
return s;
else if (s+b==g)
return s && b;
else if (s + c==g)
return s && c;
else if (s+d==g)
return s && d;
else
System.out.println("No Answer");
}
您可以让该方法返回一个数组int
:
public static int[] calc (int s, int b, int c, int d, int g)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)