求程序。求程序阿, 求在线看片的网站等 谢谢了。

c程序问题,,求助!!在线等!!谢谢!!!_百度知道
c程序问题,,求助!!在线等!!谢谢!!!
1. 黄金队列黄金分割数0.618与美学有重要的关系。舞台上报幕员所站的位置大约就是舞台宽度的0.618处,墙上的画像一般也挂在房间高度的0.618处,甚至股票的波动据说也能找到0.618的影子....
黄金分割数是个无理数,也就是无法表示为两个整数的比值。0.618只是它的近似值,其真值可以通过对5开方减去1再除以2来获得,我们取它的一个较精确的近似值:0.618034
有趣的是,一些简单的数列中也会包含这个无理数,这很令数学家震惊!
1 3 4 7 11 18 29 47 .... 称为“鲁卡斯队列”。它后面的每一个项都是前边两项的和。
如果观察前后两项的比值,即:1/3,3/4,4/7,7/11,11/18 ... 会发现它越来越接近于黄金分割俯甫碘晃鄢浩碉彤冬廓数!
你的任务就是计算出从哪一项开始,这个比值四舍五入后已经达到了与0.618034一致的精度。
请写出该比值。格式是:分子/分母。比如:29/47/*黄金队列*/#include &stdio.h&#define N 40#include &math.h&main(){
double a[N],s=0;
a[0]=1,a[1]=3;
for(i=2;i&N;i++)
a[i]=a[i-1]+a[i-2];
for(i=0;i&N;i++)
printf(&%.0f &,a[i]);
while((s)!=0.618034) {
s=a[i]/a[i+1];
printf(&\n
%.0f/%.0f %f
\n&,a[z],a[z+1],s); }
就是执行不了!!!求原因!!谢谢各位啦!!!
提问者采纳
因为double型是浮点数,所以判断句while((s)!=0.618034)永远为真,所以程序会一直执行下去改成 while(0.618034-俯甫碘晃鄢浩碉彤冬廓s&0.000001)就行了
浮点型的范围是多少?不是六位小数吗?是表示 他的小数点在变,可是详细点是怎么样啊!!谢谢!!帮帮忙!!
因为实数有无穷多个,计算机是无法把他们全都表示出来的,所以采用浮点数来表示,具体你可以百度一下浮点型。
提问者评价
好吧!!谢谢啦!!
其他类似问题
为您推荐:
c程序的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁【C程序作业】速求答案!在线等!谢谢! !!_百度知道
【C程序作业】速求答案!在线等!谢谢! !!
谢谢,输出n行2n-1列的空心三角形图案输入正整数n。一下是n等于4时的图案:* * * * * * *
*求源代码以及运行结果的jpg格式截图
如有好答案,追加30分,谢谢!
提问者采纳
for(j=0;);2*n-1;; scanf(&pl
if(i==j||j==2*n-2-i)
printf(&*&quot.h&);\);n;intmain(void){ &%d&quot,j;n&
else printf(&i++){
printf(&quot,n; printf(&quot:&#92#include&n&j++){
if(i==0)printf(&*&); for(i=0;);i&j&
} } return 0,&n)
提问者评价
其他类似问题
为您推荐:
您可能关注的推广
c程序的相关知识
其他1条回答
printf(&);}&nbsp.jpg" esrc="{&&}&&*&&*&&&&nbsp.h&&&&&nbsp,&printf(&for(j=1;&i&&&&&nbsp,k++)&nbsp,j;&/zhidao/wh%3D600%2C800/sign=9b64a50f252dd42a5f5c09ad330b778d/dbb44aed2e738bd4ffb87d;int&&&\n&quot.k;printf(&=2*i-1;main(){&&&&}&nbsp.baidu://e;{&nbsp.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="for(l=0.for(i=n;&&int&else&nbsp.{&nbsp.else&if(i==n)&&&scanf(&&i;&l&lt,n;&).com/zhidao/pic/item/dbb44aed2e738bd4ffb87d;&&&&&&nbsp://e;&&&0;printf(&&}&l++)&&&nbsp,k=0;&}&nbsp,l;{&{&&j++)&&&)#include&&&nbsp.);j&&printf(&/zhidao/wh%3D450%2C600/sign=78d5c66d5bb5c9ea62a60be7e0099a36/dbb44aed2e738bd4ffb87d;&&&&&&&&}}<a href="&if(j==1||j==2*i-1)&&&{&n););%d&;i--;&nbsp://e;&quot
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁> 求大神帮忙是缩短下程序谢谢在线等voidkeyscan(){uchartemp,P1=0x
求大神帮忙是缩短下程序谢谢在线等voidkeyscan(){uchartemp,P1=0x
shucunbin & &
发布时间: & &
浏览:66 & &
回复:1 & &
悬赏:0.0希赛币
求大神帮忙是缩短下程序
在线等void&&keyscan()
uchar&temp,
temp=temp&0xf0;
if(temp!=0xf0)
&&delayms(10);
&&temp=P1;
&&temp=temp&0xf0;
&&if(temp!=0xf0)
&&&temp=P1;
&&&switch(temp)
&&&case&0xee:
&&&&&&&key=11;
&&&case&0xde:
&&&&&&key=12;
&&&case&0xbe:
&&&&&&key=13;
&&&case&0x7e:
&&&&&&key=14;
&&&while(temp!=0xf0)
&&&&temp=P1;
temp=temp&0xf0;
display(key);
temp=temp&0xf0;
if(temp!=0xf0)
&&delayms(10);
&&temp=P1;
&&temp=temp&0xf0;
&&if(temp!=0xf0)
&&&temp=P1;
&&&switch(temp)
&&&case&0xed:
&&&&&&&key=21;
&&&case&0xdd:
&&&&&&key=22;
&&&case&0xbe:
&&&&&&key=23;
&&&case&0x7e:
&&&&&&key=24;
&&&while(temp!=0xf0)
&&&&temp=P1;
temp=temp&0xf0;
display(key);
temp=temp&0xf0;
if(temp!=0xf0)
&&delayms(10);
&&temp=P1;
&&temp=temp&0xf0;
&&if(temp!=0xf0)
&&&temp=P1;
&&&switch(temp)
&&&case&0xeb:
&&&&&&&key=31;
&&&case&0xdb:
&&&&&&key=32;
&&&case&0xbb:
&&&&&&key=33;
&&&case&0x7b:
&&&&&&key=34;
&&&while(temp!=0xf0)
&&&&temp=P1;
temp=temp&0xf0;
display(key);
temp=temp&0xf0;
if(temp!=0xf0)
&&delayms(10);
&&temp=P1;
&&temp=temp&0xf0;
&&if(temp!=0xf0)
&&&temp=P1;
&&&switch(temp)
&&&case&0xe7:
&&&&&&&key=41;
&&&case&0xd7:
&&&&&&key=42;
&&&case&0xb7:
&&&&&&key=43;
&&&case&0x77:
&&&&&&key=44;
&&&while(temp!=0xf0)
&&&&temp=P1;
temp=temp&0xf0;
display(key);
  uchar&trans(uchar&t)&{
&&&&static&uchar&s[16]={0xee,0xde,0xbe,0x7e,0xed,0xdd,0xbe,0x7e,0xeb,0xdb,0xbb,0x7b,0xe7,0xd7,0xb7,0x77};
&&&&static&uchar&d[16]={&&11,&&12,&&13,&&14,&&21,&&22,&&23,&&24,&&31,&&32,&&33,&&34,&&41,&&42,&&43,&&44};
&&&&int&i;
&&&&for&(i=0;i&16;i++)&if&(s[i]==t)&return&d[i];
&&&&printf("oops!\n");
&&&&return&0;
void&&keyscan()
&&&&uchar&temp,
&&&&uchar&p4[4]={0xfe,0xfd,0xfb,0xf7};
&&&&int&j;
&&&&for&(j=0;j&4;j++)&{
&&&&&&&&P1=p4[j];shue2010 & &
& & (0)(0)
本问题标题:
本问题地址:
温馨提示:本问题已经关闭,不能解答。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&增值电信业务经营许可证湘B2-【求助】求位能帮忙解释下下下面程序意思的人,谢谢,在线等。_vb吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:83,010贴子:
【求助】求位能帮忙解释下下下面程序意思的人,谢谢,在线等。收藏
Public Function reRs(ByVal DBName As String, ByVal ServerName As String, ByVal strSql As String) As ADODB.Recordset&&&& Dim UserName As String&&&& UserName = "sa"&&&& Dim Password As String&&&& Password = "cumt302a3885993"&&&& Set reRs = New ADODB.Recordset&&&&&&&& On Error GoTo ErrorLogArg&&&&&&&& reRs.ActiveConnection = "driver={sql server};server=" & ServerName & ";initial catalog=" & DBName & ";uid=" & UserName & ";pwd=" & Password&&&& reRs.CursorLocation = adUseClient&&&& reRs.CursorType = adOpenDynamic&&&& reRs.LockType = adLockOptimistic&&&& reRs.Open strSql&&&& Exit Function&&&&ErrorLogArg:&&&& Debug.Print Err.DescriptionOn Error GoTo Termination&&&& Debug.Print strSql&&&&&&&& reRs.ActiveConnection = "driver={sql server};server=" & ServerName & ";initial catalog=" & DBName & ";uid=;pwd="&&&& reRs.CursorLocation = adUseClient&&&& reRs.CursorType = adOpenDynamic&&&& reRs.LockType = adLockOptimistic&&&& reRs.Open strSql&&&&&&&& Exit FunctionTermination:&&&& Debug.Print Err.Description&&&&&&& EndEnd FunctionPublic Function AddDate(rs As ADODB.Recordset, ByVal DBName As String, ByVal ServerName As String, ByVal strSql As String, DBopened As Boolean) As Boolean&&&& On Error GoTo ErrHandle&&&& If Not DBopened Then&&&&&&&& Set rs = reRs(DBName, ServerName, strSql)&&&&&&&& DBopened = True&&&& Else&&&&&&&& rs.Open strSql&&&& End If&&&& 'Debug.Print strSql&&&& AddDate = True&&&& Exit FunctionErrHandle:&&&& AddDate = False
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或

我要回帖

更多关于 求国外在线视频你懂的 的文章

 

随机推荐