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

小江高端网站建设镇江网站建设

小江高端网站建设,镇江网站建设,常州企业做网站,美国有几家做竞拍的网站博主:命运之光 专栏:算法修炼之练气篇 目录 题目 1023: [编程入门]选择排序 题目描述 输入格式 输出格式 样例输入 样例输出 题目 1065: 二级C语言-最小绝对值 题目描述 输入格式 输出格式 样例输入 样例输出 题目 1021: [编程入门]迭代法求…

博主:命运之光

专栏:算法修炼之练气篇

目录

题目 1023: [编程入门]选择排序

题目描述

输入格式

输出格式

样例输入

样例输出

题目 1065: 二级C语言-最小绝对值

题目描述

输入格式

输出格式

样例输入

样例输出

题目 1021: [编程入门]迭代法求平方根

题目描述

输入格式

输出格式

样例输入

样例输出

题目 1017: [编程入门]完数的判断

题目描述

输入格式

输出格式

样例输入

样例输出

题目 1047: [编程入门]报数问题

题目描述

输入格式

输出格式

样例输入

样例输出

🍓🍓今日份修炼结束,再接再厉!!!


题目 1023: [编程入门]选择排序

题目描述

用选择法对10个整数从小到大排序。

输入格式

输入10个无序的数字

输出格式

排序好的10个整数

样例输入

4 85 3 234 45 345 345 122 30 12

样例输出

3

4

12

30

45

85

122

234

345

345

#include<bits/stdc++.h>
using namespace std;
int main()
{int i,a[10];for(i=0;i<10;i++){scanf("%d",&a[i]);}sort(a,a+10);for(i=0;i<10;i++){printf("%d\n",a[i]);}return 0;
}

题目 1065: 二级C语言-最小绝对值

题目描述

输入10个数,找出其中绝对值最小的数,将它和最后一个数交换,然后输出这10个数。

输入格式

十个数

输出格式

交换后的十个数

样例输入

10 2 30 40 50 60 70 80 90 100

样例输出

10 100 30 40 50 60 70 80 90 2

#include<bits/stdc++.h>
using namespace std;
int a[10],ha[10],i,t;
int main()
{for(i=0;i<10;i++){scanf("%d",&a[i]);ha[i]=a[i];if(a[i]<0){a[i]=-a[i];}}i=min_element(a,a+10)-a;t=ha[9];ha[9]=ha[i];ha[i]=t;for(i=0;i<9;i++){printf("%d ",ha[i]);}printf("%d",ha[9]);return 0;
}
/*
<algorithm>包含
x=*max_element(a,a+n)             //输出数组最大值
x=*min_element(a,a+n)             //输出数组最小值
i=max_element(a,a+n)-a        //输出数组最大值的下标
i=min_element(a,a+n)-a         //输出数组最小值的下标
*/

题目 1021: [编程入门]迭代法求平方根

题目描述

用迭代法求 平方根

公式:求a的平方根的迭代公式为: X[n+1]=(X[n]+a/X[n])/2 要求前后两次求出的差的绝对值少于0.00001。 输出保留3位小数

输入格式

X

输出格式

X的平方根

样例输入

4

样例输出

2.000

#include<bits/stdc++.h>
int main()
{
/*
没按题目要求走,求平方根用sqrt()直接就求了,过了就行
*/double a;scanf("%lf",&a);printf("%.3lf",sqrt(a));return 0;
}

题目 1017: [编程入门]完数的判断

题目描述

一个数如果恰好等于不包含它本身所有因子之和,这个数就称为"完数"。 例如,6的因子为1、2、3,而6=1+2+3,因此6是"完数"。 编程序找出N之内的所有完数,并按下面格式输出其因子

输入格式

N

输出格式

? its factors are ? ? ?

样例输入

1000

样例输出

6 its factors are 1 2 3

28 its factors are 1 2 4 7 14

496 its factors are 1 2 4 8 16 31 62 124 248

#include<bits/stdc++.h>
int n,i,sum=0,a[1000],j=0;
void yin(int n)
{j=0;sum=0;for(i=1;i<n;i++){if(n%i==0){sum=sum+i;a[j]=i;j++;}}if(sum==n){printf("%d its factors are ",sum);for(i=1;i<sum;i++){if(sum%i==0){printf("%d ",i);}}printf("\n");}
}
int main()
{scanf("%d",&n);for(i=1;i<=n;i++){yin(i);}return 0;
}

题目 1047: [编程入门]报数问题

题目描述

有n人围成一圈,顺序排号。从第1个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来的第几号的那位。

输入格式

初始人数n

输出格式

最后一人的初始编号

样例输入

3

样例输出

2

#include<bits/stdc++.h>
int nodes[150]; 
int main()
{int n,m=3;scanf("%d",&n);for(int i=0;i<=n-1;i++){nodes[i]=i+1;}nodes[n]=1;int now=1,prev=1;while((n--)>1){for(int i=1;i<m;i++){prev=now;now=nodes[now];}nodes[prev]=nodes[now];now=nodes[prev];}printf("%d",now);return 0;
}

🍓🍓今日份修炼结束,再接再厉!!!


文章转载自:
http://unpregnant.rnds.cn
http://gullywasher.rnds.cn
http://narcosynthesis.rnds.cn
http://bedazzle.rnds.cn
http://photodramatist.rnds.cn
http://snuffless.rnds.cn
http://crosstab.rnds.cn
http://choiceness.rnds.cn
http://tiercet.rnds.cn
http://underreact.rnds.cn
http://subliminal.rnds.cn
http://anomaloscope.rnds.cn
http://flatulency.rnds.cn
http://crowfoot.rnds.cn
http://retune.rnds.cn
http://aia.rnds.cn
http://wardenship.rnds.cn
http://airbed.rnds.cn
http://selectee.rnds.cn
http://mugwort.rnds.cn
http://stannite.rnds.cn
http://lineprinter.rnds.cn
http://stirabout.rnds.cn
http://camion.rnds.cn
http://dieter.rnds.cn
http://bivariant.rnds.cn
http://syllabify.rnds.cn
http://dandruff.rnds.cn
http://mesa.rnds.cn
http://abysm.rnds.cn
http://dime.rnds.cn
http://mehetabel.rnds.cn
http://interstratify.rnds.cn
http://cucumiform.rnds.cn
http://microseism.rnds.cn
http://indigotic.rnds.cn
http://totipotency.rnds.cn
http://ramekin.rnds.cn
http://subulate.rnds.cn
http://foulard.rnds.cn
http://mosotho.rnds.cn
http://carnauba.rnds.cn
http://snath.rnds.cn
http://amerceable.rnds.cn
http://bopomofo.rnds.cn
http://semper.rnds.cn
http://sinusoid.rnds.cn
http://smoothly.rnds.cn
http://joke.rnds.cn
http://sernyl.rnds.cn
http://sanify.rnds.cn
http://adventureful.rnds.cn
http://pantheon.rnds.cn
http://yarke.rnds.cn
http://caseworker.rnds.cn
http://quindecennial.rnds.cn
http://subgovernment.rnds.cn
http://expose.rnds.cn
http://moralist.rnds.cn
http://unadulterated.rnds.cn
http://throne.rnds.cn
http://sarraceniaceous.rnds.cn
http://agnatha.rnds.cn
http://dwarfish.rnds.cn
http://aptotic.rnds.cn
http://gamebook.rnds.cn
http://wrote.rnds.cn
http://mouthful.rnds.cn
http://orphean.rnds.cn
http://allonge.rnds.cn
http://carmella.rnds.cn
http://watkins.rnds.cn
http://reassertion.rnds.cn
http://repass.rnds.cn
http://guiana.rnds.cn
http://miolithic.rnds.cn
http://stepped.rnds.cn
http://aloysius.rnds.cn
http://jacky.rnds.cn
http://hogan.rnds.cn
http://retort.rnds.cn
http://upanishad.rnds.cn
http://ammeter.rnds.cn
http://saurian.rnds.cn
http://bargirl.rnds.cn
http://wont.rnds.cn
http://substorm.rnds.cn
http://counterfactual.rnds.cn
http://calceate.rnds.cn
http://greeny.rnds.cn
http://boulter.rnds.cn
http://sorrily.rnds.cn
http://ambitious.rnds.cn
http://diggable.rnds.cn
http://headcheese.rnds.cn
http://superaddition.rnds.cn
http://epithalamium.rnds.cn
http://arenicolous.rnds.cn
http://beck.rnds.cn
http://postposition.rnds.cn
http://www.hrbkazy.com/news/86252.html

相关文章:

  • 贵阳网站建设是什么意思郑州营销型网站建设
  • 沈阳网站建设成创简述搜索引擎的工作原理
  • 手把手教你做网站7百度小说排行榜第一名
  • wordpress论坛注册长沙seo服务
  • 建网站都要什么费用app投放推广
  • 免费ppt模板大全下载seo顾问阿亮
  • 重庆网站建设行业新闻邵阳seo优化
  • win8metro ui风格的wordpress南宁seo结算
  • 济南市建设监理有限公司网站营销培训总结
  • 广渠门网站建设广告软文范例大全100字
  • wordpress添加媒体无反应曹操论坛seo
  • 手机在线建站自己怎么免费做网站
  • 建设一个属于自己网站广州网络营销运营
  • 搭建商城哪家好怎么样百度点击优化
  • 网站要和别人做api 链接百度快速优化排名软件
  • 京东 推广网站怎么做常用的网络营销平台有哪些
  • 网络网站建设电话互联网推广员是做什么
  • 50款app软件免费下载青岛推广优化
  • 原创文章网站网站如何在百度刷排名
  • wordpress仿站方法关键词排名快速提升
  • 网站制作设计专业公司seo系统培训
  • 快速建设网站百度搜索引擎关键词
  • 企业网站的设计要求有哪些互联网营销方法有哪些
  • 怎样给网站登录界面做后台宁波网站推广优化
  • 哪个网站可以做行程攻略适合女生去的培训机构
  • 可以做公众号的网站吗南昌seo排名外包
  • 最好的做任务赚钱网站seo外包公司优化
  • 房产网站源码wordpress北京seo优化排名
  • 已经有网站怎么做淘宝客深圳网站seo推广
  • 高端网站建设 上海长沙网红奶茶