会计考友 发表于 2012-8-4 12:33:16

2012JAVA模拟试题及答案:编程题20

【程序20】   
题目:有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
public class lianxi20 {
public static void main(String[] args) {
    int x = 2, y = 1, t;
    double sum = 0;
    for(int i=1; i
页: [1]
查看完整版本: 2012JAVA模拟试题及答案:编程题20