摘要:
大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项。public class Solution {public int Fibonacci(int n) {int target=0;if(n==0)return 0;if(n==1)return 1;int one=0;in... 阅读全文
摘要:
题目描述用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。import java.util.Stack;public class Solution {Stack stack1 = new Stack();Stack stack2 = new Stack();publ... 阅读全文
摘要:
What will be printed when you execute the following code?class C { C() { System.out.print("C"); }}class A { C c = new C(); A() { this("A"); Syst... 阅读全文