| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 502 人关注过本帖
标题:大菜鸟问问题啦!
只看楼主 加入收藏
qiaqiamao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-11-9
收藏
 问题点数:0 回复次数:4 
大菜鸟问问题啦!
请教一下各位高手:
#include<stdio.h>
void main()
{
double a[7],b[7],c[7],s=0;
int i,n;
a[7]={0.4404,0.0432,0.0405,0.0284,0.0174,0.0290,0.4011};
b[7]={256,46.5,14.3,5.35,1.72,0.70,0.052 };
for(n=1000;n<=5000;n++)
{
for (i=0;i<=6;i++)
{c[i]=a[i]/(b[i]-(b[i]-1)*n);
printf("%f",c[i]);
printf("\n");
s=s+c[i];
}
if(s==1)break;
printf("NL=%f",n/10000);
}
}
搜索更多相关主题的帖子: 大菜 
2006-11-09 12:36
csight
Rank: 1
等 级:新手上路
威 望:1
帖 子:293
专家分:0
注 册:2006-6-11
收藏
得分:0 
double a[7]={0.4404,0.0432,0.0405,0.0284,0.0174,0.0290,0.4011};
double b[7]={256,46.5,14.3,5.35,1.72,0.70,0.052 };
必须初始化

头可断,发型不可乱;血可流,皮鞋不可不擦油;
2006-11-09 12:52
shuaiye
Rank: 1
等 级:新手上路
帖 子:445
专家分:0
注 册:2006-5-15
收藏
得分:0 
[QUOTE]#include<stdio.h>
void main()
{
double a[7],b[7],c[7],s=0;
int i,n;
a[7]={0.4404,0.0432,0.0405,0.0284,0.0174,0.0290,0.4011};/有这样初始化数组的吗??自创的还是.....?
b[7]={256,46.5,14.3,5.35,1.72,0.70,0.052 };
for(n=1000;n<=5000;n++)
{
for (i=0;i<=6;i++)
{c[i]=a[i]/(b[i]-(b[i]-1)*n);
printf("%f",c[i]);
printf("\n");
s=s+c[i];
}
if(s==1)break;
printf("NL=%f",n/10000);
}
[/QUOTE]

由于工作,N久都没来了!
2006-11-09 12:54
qiaqiamao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-11-9
收藏
得分:0 
非常感谢!
2006-11-10 18:34
lwn
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2006-8-22
收藏
得分:0 

#include<stdio.h>
void main()
{
double a[7] = {0.4404,0.0432,0.0405,0.0284,0.0174,0.0290,0.4011};
double b[7] = {256,46.5,14.3,5.35,1.72,0.70,0.052 };
double c[7];
double s=0;
int i;
int n;

for (n=1000; n<=5000; n++)
{
for (i=0; i<=6; i++)
{
c[i] = a[i]/(b[i]-(b[i]-1)*n);
printf ("%f", c[i]);
printf ("\n");
s = s + c[i];
}
if (s==1)
break;
printf("NL=%f",n/10000);

}
}
养成好的书写习惯!


学不好C语言,就娶不上媳妇了!
2006-11-10 21:35
快速回复:大菜鸟问问题啦!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016266 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved