2014年7月9日

摘要: 1.求Fibonacci数列的前40个数。这个数的特点:第1,2两个数为1。从第3个数开始,该数是其前两个数之和。法1:#include int main(){int f1=1,f2=1,f3;printf("%d\n%d\n",f1,f2);for(i=1; iint main(){int f1=... 阅读全文

posted @ 2014-07-09 17:00 chen hui 阅读(227) 评论(0) 推荐(0)


2014年7月6日

摘要: #include int main(){int year,leap;scanf("%d",&year);if(year%4!==0)leap=0;else if(year%100!=0)leap=1;else if(year%400!=0)leap=0;elseleap=1;if(leap)prin... 阅读全文

posted @ 2014-07-06 16:57 chen hui 阅读(1413) 评论(0) 推荐(0)


2014年7月3日

摘要: 1.用温度计测出用华氏表示的温度#include int main(){float f,c;f=64.0;c=(5.0/9)*(f-32);printf("f=%f\nc=%f\n",f,c);return 0;}2.计算存款利息,有一百元,想存一年。有3种方法:活期,年利率为r1;一年定期,年利率... 阅读全文

posted @ 2014-07-03 17:13 chen hui 阅读(352) 评论(0) 推荐(0)


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3