> 数学 >
C机试题 求[1,800]之间能被3和8整除的数的个数
已知一个数列的前三项为0,以后各项都是其相邻的前三项之和,求该数列前30项之和
计算并输出 1+1/3+1/5+...+1/99 的值,结果保留2位小数
人气:344 ℃ 时间:2020-04-16 16:50:50
解答
#include
int main()
{
int i,count=0;
for(i=1;i<=800;i++)
if(i%3==0&&i%8==0)count++;
printf("count=%d\n",count);
return 0;
}已知一个数列的前三项为0,0,1,以后各项都是其相邻的前三项之和,求该数列前30项之和计算并输出 1+1/3+1/5+...+1/99 的值,结果保留2位小数jiqiuthank you
推荐
猜你喜欢
© 2025 79432.Com All Rights Reserved.
电脑版|手机版