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

文档共享网站建设系统优化的例子

文档共享网站建设,系统优化的例子,香港特别行政区依法实行,wordpress限制搜索次数🌸博主主页:釉色清风🌸文章专栏:算法练习🌸今日语录:You don’t know until you try. 文章简介:下面的题目是AcWing网站语法基础练习篇的第一小节,内容基础,难度&#xf…
  • 🌸博主主页:@釉色清风
  • 🌸文章专栏:算法练习
  • 🌸今日语录:You don’t know until you try.

文章简介:下面的题目是AcWing网站语法基础练习篇的第一小节,内容基础,难度:易。
主要都是简单的输入输出练习。仅以此记录自己的学习。

🪻1.A+B

在这里插入图片描述
代码如下:

#include<iostream>
using namespace std;
int main()
{int A,B;cin>>A>>B;cout<<A+B<<endl;return 0;
}

🪻2.差


代码如下:

#include<iostream>
using namespace std;
int main()
{int A,B,C,D;cin>>A;cin>>B;cin>>C;cin>>D;cout<<"DIFERENCA = "<<(A*B-C*D)<<endl;return 0;
}

🪻3.圆的面积


代码如下:

#include <iostream>
using namespace std;
int main()
{double r,A;cin>>r;A=3.14159*r*r;printf("A=%.4f",A);return 0;
}

🪻4.平均数1


代码如下:

#include <iostream>
using namespace std;
int main()
{double A,B,S;cin>>A;cin>>B;S=(A*3.5+B*7.5)/11;printf("MEDIA = %.5f",S);return 0;
}

🪻5.工资


代码如下:

#include <iostream>
using namespace std;
int main()
{int id;//编号int hour; //时长double salary;//时薪cin>>id;cin>>hour;cin>>salary;cout<<"NUMBER = "<<id<<endl;printf("SALARY = U$ %.2f",hour*salary);return 0;
}

🪻6.油耗


代码如下:

#include <iostream>
using namespace std;
int main()
{int X;//行驶总路程double Y;//油量cin>>X;cin>>Y;printf("%.3f km/l",X/Y);return 0;
}

🪻7.两点间的距离


代码如下:

#include <iostream>
#include <cmath>
using namespace std;
int main()
{double x1,x2,y1,y2,d;cin>>x1>>y1;cin>>x2>>y2;d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));printf("%.4f",d);return 0;
}

🪻8.钞票



代码如下:

#include <iostream>
using namespace std;
int main()
{int N;cin>>N;int R100,R50,R20,R10,R5,R2,R1;int t;//临时变量R100=N/100;t=N-R100*100;R50=t/50;t=t-R50*50;R20=t/20;t=t-R20*20;R10=t/10;t=t-R10*10;R5=t/5;t=t-R5*5;R2=t/2;t=t-R2*2;R1=t;cout<<N<<endl;cout<<R100<<" "<<"nota(s) de R$ 100,00"<<endl;cout<<R50<<" "<<"nota(s) de R$ 50,00"<<endl;cout<<R20<<" "<<"nota(s) de R$ 20,00"<<endl;cout<<R10<<" "<<"nota(s) de R$ 10,00"<<endl;cout<<R5<<" "<<"nota(s) de R$ 5,00"<<endl;cout<<R2<<" "<<"nota(s) de R$ 2,00"<<endl;cout<<R1<<" "<<"nota(s) de R$ 1,00"<<endl;return 0;
}

🪻9.时间和转换


代码如下:

#include <iostream>
using namespace std;
int main()
{int N;int hour,min,sec;int t;cin>>N;hour=N/3600;t=N-hour*3600;min=t/60;t=t-min*60;sec=t;cout<<hour<<":"<<min<<":"<<sec;return 0;
}

🪻10.简单乘积


代码如下:

#include<iostream>
using namespace std;
int main()
{int A,B;cin>>A;cin>>B;cout<<"PROD = "<<A*B<<endl;return 0;
}

🪻11.简单计算



代码如下:

#include <iostream>
using namespace std;
int main()
{int num1,num2,amount1,amount2;double price1,price2;cin>>num1>>amount1>>price1;cin>>num2>>amount2>>price2;printf("VALOR A PAGAR: R$ %.2f",amount1*price1+amount2*price2);return 0;
}

🪻12.球的体积


代码如下:

#include  <iostream>
using namespace std;
int main()
{double  R,V;cin>>R;V=(4/3.0)*3.14159*R*R*R;printf("VOLUME = %.3f",V);return 0;
}

🪻13.面积



代码如下:

#include <iostream>
using namespace std;
int main()
{double A,B,C;double S1,S2,S3,S4,S5;cin>>A>>B>>C;S1=0.5*A*C;S2=3.14159*C*C;S3=0.5*(A+B)*C;S4=B*B;S5=A*B;printf("TRIANGULO: %.3f\n",S1);printf("CIRCULO: %.3f\n",S2);printf("TRAPEZIO: %.3f\n",S3);printf("QUADRADO: %.3f\n",S4);printf("RETANGULO: %.3f\n",S5);return 0;
}

🪻14.平均数2


代码如下:

#include <iostream>
using namespace std;
int main()
{double A,B,C,S;cin>>A;cin>>B;cin>>C;S=(A*2+B*3+C*5)/10;printf("MEDIA = %.1f",S);return 0;
}

🪻15.工资和奖金



代码如下:

#include <iostream>
using namespace std;
int main()
{string name;double salary,sales,P;cin>>name>>salary>>sales;P=salary+sales*0.15;printf("TOTAL = R$ %.2f",P);return 0;
}

🪻16.最大值

在这里插入图片描述
代码如下:

#include <iostream>
#include <cmath>
using namespace std;
int main()
{int A,B,C;cin>>A>>B>>C;int max;max=0.5*(A+B+abs(A-B));max=0.5*(max+C+abs(max-C));cout<<max<<" eh o maior";return 0;
}

🪻17.距离


代码如下:

#include <iostream>
using namespace std;
int main()
{int L,X;cin>>L;X=L*2;cout<<X<<" minutos";return 0;
}

这里我第一次写得没有通过,需要注意的是,如果写成L*60/30,那么int会"爆",需要将数据类型定义为long long int。或者是直接简化。

🪻18.燃料消耗


代码如下:

#include <iostream>
using namespace std;
int main()
{int v;double t;cin>>t>>v;double total;total=t*v/12.0;printf("%.3f",total);return 0;
}

🪻19.天数转换


代码如下:

#include <iostream>
using namespace std;
int main()
{int N;cin>>N;int t;int ano,mes,dia;ano=N/365;t=N-ano*365;mes=t/30;t=t-mes*30;dia=t;cout<<ano<<" ano(s)"<<endl;cout<<mes<<" mes(es)"<<endl;cout<<dia<<" dia(s)";return 0;
}
http://www.dtcms.com/wzjs/144087.html

相关文章:

  • 建设网站开发的语言有哪些百度自然搜索排名优化
  • 哪个网站有免费武汉seo首页优化公司
  • 南京市互联网平台公司seo的范畴是什么
  • 做7寸照片的网站武汉网络营销公司排名
  • 网站建设费发票广告策划书
  • 可做兼职的翻译网站有哪些网络营销课程学什么
  • 服装鞋帽商城网站建设怎么建立企业网站免费的
  • 汉中建设网站google 谷歌
  • 品牌高端网站制作网络营销策划书8000字
  • 中国建设银行网站 党费4a广告公司
  • 海城网站建设seo关键词优化排名外包
  • java网站开发面试题网站访问量统计工具
  • 南宁哪个公司做网站建设网络优化工程师招聘信息
  • 国产免费cad软件下载东莞网站建设seo
  • 网站重新设计需要多久免费入驻的跨境电商平台
  • 小说网站防盗做的好设计个人网站
  • 济南 网站 建设百度快照客服电话
  • 淮南建设厅网站西安seo引擎搜索优化
  • 龙岗区是深圳最差的区武汉seo诊断
  • 企业网站的管理系统上海优质网站seo有哪些
  • 播放视频网站怎么做百度账号登陆
  • 有没有专门做游戏人物的绅士视频网站专业的网络推广
  • 做网站做什么好uc浏览器网页版入口
  • 常熟做网站价格网络营销的主要内容包括
  • 单位做网站的目的腾讯广告投放平台
  • b2b平台哪个好seo顾问服务四川
  • 湛江网站推广优化网站优化关键词排名
  • 宝鸡外贸网站建设黄页引流推广链接
  • 教育机构网站是seo优化入门教程
  • 集团门户网站建设策划seo优化公司排名