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

怎么创建私人网站wordpress 火车采集

怎么创建私人网站,wordpress 火车采集,wordpress公司网页主题,wordpress外贸网站建站教程B2093 查找特定的值 - 洛谷 题⽬要求下标是从0开始的#xff0c;和数组的下标是吻合的#xff0c;存放数据应该从下标0开始n的取值范围是1~10000数组中存放的值的绝对值不超10000#xff0c;说明int类型就⾜够了找到了输出下标#xff0c;找不到要输出-1#xff0c;这⼀点…B2093 查找特定的值 - 洛谷 题⽬要求下标是从0开始的和数组的下标是吻合的存放数据应该从下标0开始n的取值范围是1~10000数组中存放的值的绝对值不超10000说明int类型就⾜够了找到了输出下标找不到要输出-1这⼀点要注意很容易忽略 #include bits/stdc.h using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin n;vectorint arr(n);for(auto x : arr){cin x;}int a;cin a;int i 0;int flg true;for(auto x : arr){if (a x){cout i \n;flg false;break;}i;}if (flg){cout -1 \n;}return 0; }#include iostream using namespace std; const int N 10010; int arr[N]; int main() { int n 0; cin n; for (int i 0; i n; i) { cin arr[i]; } int k 0;cin k; int i 0; for (i 0; i n; i) { if (k arr[i]) { cout i endl; break; } } if (i n) cout -1 endl; return 0; }有的题⽬要求数据从下标0的位置开始存放也有些题⽬要求数据是从下标1的位置开始存放要仔细阅读题⽬。让从下标1开始存放的时候数组的开辟必须要有多余的空间使⽤如果开辟的刚刚好就会越界。数组空间的开辟要⾜够以免数据越界所以经常题⽬需要存放n个数据就开辟n10个空间这样空间就⾮常充⾜⽐较保险。其实在空间⾜够的情况下浪费⼀点空间是不影响的。动态规划相关算法⼀般都会预留好空间。⼀般数组较⼤的时候建议将数组创建成全局数组因为局部的数组太⼤的时候可能会导致程序⽆法运⾏刷题多了就⻅怪不怪了。全局变量数组是在内存的静态区开辟空间但是局部的变量数组是在内存的栈区开辟空间的每个程序的栈区空间是有限的不会很⼤。 B2089 数组逆序重存放 - 洛谷 #include bits/stdc.h using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin n;vectorint a(n);for (auto x : a){cin x; }int left 0, right n - 1;while (left right){int tmp a[left];a[left] a[right];a[right] tmp;left;right--;}for (auto x : a){cout x ; }return 0; }#include iostream using namespace std; int arr[110] { 0 }; int main() { int n 0; cin n; int i 0; for (i 0; i n; i) cin arr[i]; //逆序 int left 0; int right n - 1; while (left right) { int tmp arr[left]; arr[left] arr[right]; arr[right] tmp; left; right--; } for (i 0; i n; i) cout arr[i] ; return 0; }#include iostream using namespace std; int arr[110] { 0 }; int main() { int n 0; cin n; int i 0; for (i 0; i n; i) cin arr[i]; //逆序输出 for (i n - 1; i 0; i--) cout arr[i] ; return 0; }B2091 向量点积计算 - 洛谷 #include bits/stdc.h using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin n;vectorint a(n);for (auto x : a){cin x; }vectorint b(n);for (auto x : b){cin x; }int ans 0;for (int i 0; i n; i){ans a[i] * b[i];}cout ans \n;return 0; }#include iostream using namespace std; const int N 1010; int arr1[N]; int arr2[N]; int main() { int n 0; cin n; for (int i 0; i n; i) { cin arr1[i]; }for (int i 0; i n; i) { cin arr2[i]; } int ret 0; for (int i 0; i n; i) {ret arr1[i] * arr2[i]; } cout ret endl; return 0; }#include iostream using namespace std; const int N 1010; int arr1[N]; int main() { int n 0; int m 0; cin n; for (int i 0; i n; i) { cin arr1[i]; } int ret 0;for (int i 0; i n; i) { cin m; ret arr1[i] * m; } cout ret endl; return 0; }B2090 年龄与疾病 - 洛谷 #include bits/stdc.h using namespace std;int main() {int n;cin n;vectorint p(n);for (auto x : p){cin x; }//0-18 、 19-35 、 36-60、 61int c 0, t 0, a 0, o 0;for (auto x : p){if (x 0 x 18)c;if (x 18 x 35)t;if (x 35 x 60)a;if (x 60)o;}printf(%.2f%%\n, c * 100.0 / n);printf(%.2f%%\n, t * 100.0 / n);printf(%.2f%%\n, a * 100.0 / n);printf(%.2f%%\n, o * 100.0 / n);return 0; }这组数据不存储下来也是可以的因为只有⼀组数据所以⼀边读取⼀边统计也是可以的这样省略了数组空间的开销 #include iostream using namespace std; int n; int num; int p1, p2, p3, p4; int main() { cin n; int i 0; //输⼊⼀个处理⼀个 for (i 0; i n; i) { cin num; if (num 0 num 18) p1; else if (num 19 num 35) p2; else if (num 36 num 60) p3; else p4; } printf(%.2f%%\n, p1 * 1.0 / n * 100); printf(%.2f%%\n, p2 * 1.0 / n * 100); printf(%.2f%%\n, p3 * 1.0 / n * 100); printf(%.2f%%\n, p4 * 1.0 / n * 100); return 0; }题⽬要求输出的是百分⽐是带%的这个要特殊处理⼀下 B2092 开关灯 - 洛谷 #include bits/stdc.h using namespace std;const int N 5010; int a[N] {0};int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin n;for(int i 2; i n; i){for (int j i; j n; j){if (j % i 0){//arr[j] !arr[j];if(a[j] 1)a[j] 0;elsea[j] 1;}}}for (int i 1; i n; i){if (a[i] 0)cout i ;}cout endl;return 0; }P1428 小鱼比可爱 - 洛谷 #include bits/stdc.h using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin n;vectorint a(n);for (auto x : a){cin x; }for (int i 0; i n; i){int cnt 0;for (int j 0; j i; j){if (a[j] a[i]){cnt;}}cout cnt ;}return 0; }冒泡排序 冒泡排序的原理通过重复地遍历待排序的数列依次⽐较相邻元素并交换使得每⼀轮遍历都将未排序部分的最⼤或最⼩值“冒泡”到数列的⼀端 #include bits/stdc.h using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin n;vectorint a(n);for (auto x : a){cin x;}for (int i 0; i n - 1; i){for (int j 0; j n - 1 - i; j){if (a[j] a[j 1]){int tmp a[j];a[j] a[j1];a[j1] tmp;}}}for (auto x : a){cout x endl;}return 0; }
http://www.yayakq.cn/news/1822/

相关文章:

  • 如何制作自己的网站模版微信搜一搜seo优化
  • 备案网站大全泉州seo托管
  • 好女人生活常识网站建设网站后台asp源码
  • 品牌网站响应式网站有哪些南充房产网最新楼盘
  • 企业为什么做网站最好的建站公司
  • 上海阔达网站建设公司类似云盘 网站开发
  • 是想建个网站 用本地做服务器浙江建设干部学校网站
  • 个人网站免费模板游戏网站推广
  • 企业网站建设注意事项建设网站的岗位
  • 高仿奢侈手表网站两个男的怎么做网站
  • 帝国cms手机网站制作wordpress网站怎么建
  • 积分交易网站开发群晖手动安装wordpress
  • 平面电商网站建设iis 架设 wordpress
  • 绵阳市三台县城乡建设局网站品牌建设的核心
  • 南通六建网站微信商城开发定制
  • 如何查看网站抓取频率门户网站设计行业
  • 网址站点异常怎么解决网站建设优化服务器
  • 家居建材网站源码全屋设计的软件
  • 网站布局优化策略活动推广软文
  • 山东兴华建设集团有限公司网站网站建设技术服务费怎么写分录
  • 上海网站快速排名优化桂林新闻桂林人论坛
  • 营销型网站建设团队抖音seo什么意思
  • 网站开发工程师累不累12316网站建设方案
  • 建站公司网站模板论坛合肥网站建设案例
  • 修改网站参数网站建设为什么要全款
  • wordpress视频网站用什么播放器科技有限公司取名字
  • 上海网站备案核验wordpress汉化安装
  • 时代空间网站网络服务是什么
  • 樟木头网站建设莱州免费发布信息的网站平台
  • 万网云虚拟主机上传网站什么视频网站可以做链接地址