代码拉取完成,页面将自动刷新
import java.util.Stack;
/**
* Created by 李天龙
*/
public class Serise {
public static void main(String args[]) {
Stack<Integer> stack = new Stack<Integer>();
stack.push(new Integer(3));
int a=stack.peek();
System.out.println(a);
stack.push(new Integer(8));
int b=stack.peek();
System.out.println(b);
int n=1;
while (n < 10) {
for (int i = 1; i < 3; i++) {
Integer A1 = stack.pop();
int a1 = A1.intValue();
Integer A2 = stack.pop();
int a2 = A2.intValue();
Integer temp = new Integer(2 * a1 + 2 * a2);
System.out.println("" + temp.toString());
stack.push(temp);
stack.push(a2);
n++;
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。