a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 119|回复: 0

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
【程序20】   
* |) q/ o( A& z- O. t" H0 t题目:有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。  
( p  u) c: r; z2 ?' fpublic class lianxi20 { * C" A' @  _, O8 A. j% F
public static void main(String[] args) {
7 @6 `: o+ i3 @5 b$ j9 a( `    int x = 2, y = 1, t;
- T3 W! ~4 b4 n  |5 }7 p, T    double sum = 0; " P) E) ]" c7 u( m
    for(int i=1; i
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-5 22:46 , Processed in 0.248445 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表