一二三四五六七吧 关注:342贴子:4,140
  • 0回复贴,共1

#include&nbsp;&lt;stdio.h&gt;<

只看楼主收藏回复

#include&nbsp;&lt;stdio.h&gt;
int&nbsp;main()
{
double&nbsp;assets,debt,invest,value,pricing;
printf(&quot;请输入上市公司资产总值,负债总值,投入资本总额,每股面值(用空格分开):\n&quot;);
scanf(&quot;%lf%lf%lf%lf&quot;,&amp;assets,&amp;debt,&amp;invest,&amp;value);
pricing=(assets-debt)/invest*value;
printf(&quot;上市公司资产总值assets=%.2e\n&nbsp;负债总值debt=%.2e\n&nbsp;投入总资本额invest=%.2e\n&nbsp;每股面值value=%.2e\n&quot;,assets,debt,invest,value);
printf(&quot;计算所得股票价格为pricing=%.2f\n&quot;,pricing);
return&nbsp;0;&nbsp;
}
#include&lt;stdio.h&gt;
int&nbsp;main()
{
unsigned&nbsp;int&nbsp;year=0;
int&nbsp;res=0;
printf(&quot;请输入年份:&quot;);
scanf(&quot;%d&quot;,&amp;year);
res=((year%4==0)&amp;&amp;(year%100!=0))||(year%400==0);
printf(&quot;res=0是闰年\nres=1是平年\n&quot;);
printf(&quot;结果是:\nres=%d\n&quot;,res);
return&nbsp;0;
}


IP属地:黑龙江来自Android客户端1楼2018-04-11 16:36回复