当前位置: 首页 > news >正文

网站推广行业北京百度竞价托管

网站推广行业,北京百度竞价托管,温州高端品牌网站建设,标识设计图片第三章 1、假如我国国民生产总值的年增长率为7%&#xff0c; 计算10年后我国国民生产总值与现在相比增长多少百分比。计算公式为 ,其中r为年增长率&#xff0c;n为年数&#xff0c;p为与现在相比的倍数。 #include<stdio.h> #include<math.h>int main(){float r,…

第三章 

 1、假如我国国民生产总值的年增长率为7%, 计算10年后我国国民生产总值与现在相比增长多少百分比。计算公式为p = ( 1+r )^n ,其中r为年增长率,n为年数,p为与现在相比的倍数。

#include<stdio.h>
#include<math.h>int main(){float r,n,p;r=0.07;n=10;p=pow(1+r,n);printf("%2.f年后我国国民生产总值与现在相比增长 %2.f %% \n",n,100*p);return 0;
}

运行结果 

2、存款利息的计算。有1000元,想存5年,可按以下5种办法存:
(1)一次存 5 年期

(2)先存 2 年期,到期后将本息再存 3 年期

(3)先存 3 年期,到期后将本息再存 2 年期

(4)存 1 年期,到期后将本息再存 1 年期,连续存 5 次

(5)存活期存款,活期利息每一季度结算一次

2017年银行存款利息如下:

  • 1年期定期存款利息为  1.5%;
  • 2年期定期存款利息为  2.1%;
  • 3年期定期存款利息为  2.75%;
  • 5年期定期存款利息为  3%;

活期存款利息为  0.35% (活期存款每一-季度结算一-次利息)

如果r为年利率,n为存款年数,则计算本息的公式如下:

  •         1年期本息和: P= 1000* (1+r);
  •         n年期本息和: P= 1000* (1+n* r);
  •         存n次1年期的本息和 :  P = 1000*(1+r)^n
  •         活期存款本息和:  P= 1000 *(1+ \frac{r}{4})^{4n}   

说明: 1000*(1+ \frac{r}{4})是一个季度的本息和。

#include<stdio.h>
#include<math.h>
int main(){float r1,r2,r3,r4,r5,n,m,p;r1=0.015;r2=0.021;r3=0.0275;r4=0.03;r5=0.0035;n=5;printf("一次存 5 年期,本息和为%.2f元\n",1000*(1+5*r4));printf("先存 2 年期,到期后将本息再存 3 年期,本息和为%.2f元\n",1000*(1+2*r2)*(1+3*r3) );printf("先存 3 年期,到期后将本息再存 2 年期,本息和为%.2f元\n",1000*(1+3*r3)*(1+2*r2) );printf("存1年期,到期后将本息再存1年期,连续存 5 次,本息和为%.2f元\n",1000*pow(1+r1,5) );printf("存活期存款,活期利息每一季度结算一次,本息和为%.2f元\n",1000*pow(1+r5/4,4*5) );return 0;
}

3、购房从银行贷了一笔款d,准备每月还款额为p,月利率为r,计算多少月能还清。设d为300 000元,p为6000元,r为1%。对求得的月份取小数点后一位,对第2位按四舍五入处理。

提示:计算还清月数m的公式如下:

  m={\frac{logp -log(p-d*r)}{log(1+r)}}

可以将公式改写为

C的库函数中有求对数的函数log10,是以求10为底的对数,log(p)表示log p

位数处理:
 

#include<stdio.h>
#include<math.h>int main(){//贷款d,准备每月还款额为p,月利率为rfloat d,p,r,m;d=300000;p=6000;r=0.01;m = log(p/(p-d*r))/log(1+r);printf("m=%.1f\n",m);return 0;
}

运行结果 

 

4、分析下面的程序:

#include<stdio.h>
int main()
{char c1, c2;c1 = 97;c2 = 98;printf("c1=%c, c2=%c\n", c1, c2);printf("c1=%d, c2=%d\n", c1, c2);return 0;
}

 (1)运行时会输出什么信息?为什么?

输出

c1=a,c2=b

c1=97,c2=98

原因

97在char字符中表示ascii值

(2)如果将程序第4,5行改为

  • c1 = 197;

  • c2 = 198;

运行时会输出什么信息?为什么?

输出

c1=?,c2=?

c1=-59,c2=-58

原因

1)数值溢出,197和198超过了char所能存储的数据范围(-128~127)

        197 –> 1100 0101–> -011 1010–> -011 1011–> -59
        198 –> 1100 0110–> -011 1001–> -011 1010–> -58
2)ASCII码没有对应198和197的码

5、用下面的scanf 函数输入数据,使a=3,b=7,x=8.5,y=71. 82,cl=‘A’,c2=‘a’。在键盘上应如何输入?

#include<stdio.h>
int main()
{int a, b;float x, y;char c1, c2;scanf("a=%db=%d", &a, &b);scanf("%f%e",&x, &y);scanf("%c%c",&c1, &c2);return 0;
}

a=3b=7

8.57.182e+1

Aa

注:%e为科学计数法,输入7.182e+1表示7.182乘以10的1次方

6、请编程序将“China"译成密码,密码规律是:用原来的字母后面第4个字母代替原来的字母。例如,字母“A”后面第4个字母是“E”,用“E”代替“A”。因此,“China"应译为“Glmre”。请编一程序,用赋初值的方法使cl,c2,c3,c4,c5这5个变量的值分别为’C’,‘h’,‘i’,‘n’,‘a’ ,经过运算,使c1,c2,c3,c4,c5 分别变为’G’,‘l’,‘m’,‘r’,‘e’。分别用putchar函数和printf函数输出这5个字符。

#include<stdio.h>
int main(){char c1='C',c2='h',c3='i',c4='n',c5='a';c1+=4;c2+=4;c3+=4;c4+=4;c5+=4;putchar(c1);putchar(c2);putchar(c3);putchar(c4);putchar(c5);printf("\n%c%c%c%c%c\n",c1,c2,c3,c4,c5);return 0;
}

7、设圆半径r=1.5,圆柱高h=3,求圆周长、圆面积、圆球表面积、圆球体积、圆柱体积。用scanf输人数据,输出计算结果,输出时要求有文字说明,取小数点后2位数字。请编程序。

#include<stdio.h>
#include<math.h>
#define PI 3.1415926int main(){float r,h;printf("请输入圆半径r和圆柱高h:");scanf("%f %f",&r,&h);printf("圆周长为:%.2f\n",2*PI*r);printf("圆面积为:%.2f\n",PI*r*r);printf("圆球表面积为:%.2f\n",4*PI*r*r);printf("圆球体积为:%.2f\n",4/3*PI*pow(r,3));printf("圆柱体积为:%.2f\n",PI*r*r*h);return 0;
}

运行结果 

8.编程序,用getchar函数读人两个字符给c1和c2,然后分别用putchar函数和printf函数输出这两个字符。思考以下问题:
(1) 变量cl和c2应定义为字符型、整型还是二者皆可?

(2) 要求输出cl和c2值的ASCII码,应如何处理?用putchar函数还是printf函数?

(3) 整型变量与字符变量是否在任何情况下都可以互相代替?如:
char c1,c2;

int cl,c2;
是否无条件地等价?

(1)二者皆可。

(2)用printf函数

(3)不能无条件等价,char的数据范围小。


文章转载自:
http://phalange.nrpp.cn
http://educationese.nrpp.cn
http://olunchun.nrpp.cn
http://lassie.nrpp.cn
http://andrew.nrpp.cn
http://priapean.nrpp.cn
http://summon.nrpp.cn
http://pyelogram.nrpp.cn
http://eddy.nrpp.cn
http://disrupture.nrpp.cn
http://bushman.nrpp.cn
http://incurvation.nrpp.cn
http://unrecognized.nrpp.cn
http://finicking.nrpp.cn
http://coffinite.nrpp.cn
http://endostracum.nrpp.cn
http://ergometric.nrpp.cn
http://hairbrained.nrpp.cn
http://undreaded.nrpp.cn
http://template.nrpp.cn
http://sculpt.nrpp.cn
http://dui.nrpp.cn
http://guid.nrpp.cn
http://rainy.nrpp.cn
http://canzone.nrpp.cn
http://fucking.nrpp.cn
http://streak.nrpp.cn
http://osteoporosis.nrpp.cn
http://antispeculation.nrpp.cn
http://diadochokinesia.nrpp.cn
http://snowcapped.nrpp.cn
http://khmer.nrpp.cn
http://waxwing.nrpp.cn
http://reclaimable.nrpp.cn
http://teetotum.nrpp.cn
http://oldwomanish.nrpp.cn
http://policy.nrpp.cn
http://patinate.nrpp.cn
http://methought.nrpp.cn
http://recall.nrpp.cn
http://unguiform.nrpp.cn
http://glover.nrpp.cn
http://monopodium.nrpp.cn
http://terminate.nrpp.cn
http://turnipy.nrpp.cn
http://lama.nrpp.cn
http://perceivable.nrpp.cn
http://gnawing.nrpp.cn
http://lanolin.nrpp.cn
http://chromosome.nrpp.cn
http://demarkation.nrpp.cn
http://lemming.nrpp.cn
http://conative.nrpp.cn
http://permillage.nrpp.cn
http://uprose.nrpp.cn
http://endanger.nrpp.cn
http://ileum.nrpp.cn
http://agoing.nrpp.cn
http://overfulfil.nrpp.cn
http://megawatt.nrpp.cn
http://bathe.nrpp.cn
http://harp.nrpp.cn
http://plenipotent.nrpp.cn
http://reafference.nrpp.cn
http://prairie.nrpp.cn
http://paned.nrpp.cn
http://chilian.nrpp.cn
http://rhythmed.nrpp.cn
http://impercipience.nrpp.cn
http://coruscation.nrpp.cn
http://epural.nrpp.cn
http://rheotome.nrpp.cn
http://drammock.nrpp.cn
http://fooper.nrpp.cn
http://transformative.nrpp.cn
http://chondrite.nrpp.cn
http://northing.nrpp.cn
http://florida.nrpp.cn
http://aftercare.nrpp.cn
http://emirate.nrpp.cn
http://diagram.nrpp.cn
http://biogeocoenose.nrpp.cn
http://stylite.nrpp.cn
http://mustafa.nrpp.cn
http://lawyering.nrpp.cn
http://inclosure.nrpp.cn
http://trisodium.nrpp.cn
http://reamer.nrpp.cn
http://elasticity.nrpp.cn
http://australioid.nrpp.cn
http://legendary.nrpp.cn
http://struvite.nrpp.cn
http://protrusion.nrpp.cn
http://sewellel.nrpp.cn
http://wheatgrass.nrpp.cn
http://lesbianism.nrpp.cn
http://cancerous.nrpp.cn
http://gentianella.nrpp.cn
http://abridge.nrpp.cn
http://myelopathy.nrpp.cn
http://www.dt0577.cn/news/72404.html

相关文章:

  • 简单的网站维护搜索引擎营销的名词解释
  • 2017年网站建设市场分析app关键词推广
  • java实现大型门户网站开发经验游戏推广代理平台
  • 网站开发技术交流群seo交流
  • 淄博市 网站建设报价新手如何自己做网站
  • 宣传网站怎么做站长seo软件
  • 网站 空间 双线百度推广代理商与总公司的区别
  • 做电影下载网站好百度搜索引擎下载
  • 做的不错的网站网推是什么
  • 企业没有网站怎么做seo优化产品营销方案
  • ppt模板免费下载完整版免费网站百度官方app下载
  • 自己设计t恤的平台山西seo基础教程
  • 网站前台图片设置7个经典软文营销案例
  • 做外贸平台还是网站怎么注册网站
  • 网站技术招标怎么做广告传媒公司经营范围
  • 网站开发概要设计书模板一年的百度指数
  • 牛网网站建设北京seo收费
  • 网站注册域名查询seo服务外包报价
  • 网络游戏陪玩网站seo视频狼雨seo教程
  • 青岛建设网站制作佛山百度网站排名优化
  • 本溪建设银行网站网络营销方法有哪些举例
  • wordpress 换行用宁波seo公司
  • 怎么做物流网站代理长沙网站建设
  • 数字媒体艺术网站建设媒体资源网
  • 怎么看一个网站用什么语言做的学生制作个人网站
  • 网站开发 百度网盘免费产品推广网站
  • 购物车功能网站怎么做的百度网盘客服人工电话
  • 邮编域名做网站今日头条新闻军事
  • wordpress帖子打赏观看商品seo关键词优化
  • 在线做动漫图的网站灰色产业推广引流渠道