C语言简易方法 解题思路:注意事项:参考代码:#include#definem100000intmain(){intN,n,a[m],i,c;scanf("%d",&N);for(i=0;i 题解列表 2025年12月09日 0 点赞 0 评论 298 浏览 评分:0.0 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; int a[10000]={0}; int i=0; int m; scanf("%d",&n);…… 题解列表 2022年10月26日 0 点赞 0 评论 497 浏览 评分:0.0 查找特定的值解法:数据结构顺序表解法。在一个序列(下标从1开始)中查找一个给定的值,输出第一次出现的位置。 解题思路:因为最近学习数据结构,就用数据结构的顺序表来解题,基本想法就是使用顺序表的模板来进行增删改查的操作。显然这里只涉及到插入元素和寻找元素两个操作,至于容量扩增的问题在目前这个题里并不需要,因为使用的capacity也算是刚刚好。注意事项:参考代码:////Createdby29714on25- 题解列表 2025年09月02日 0 点赞 0 评论 631 浏览 评分:0.0 2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,m; scanf("%d",&n);//输入 int arr[10001]={0}…… 题解列表 2022年11月17日 0 点赞 0 评论 492 浏览 评分:0.0 全部遍历后再输出-1 摘要:解题思路:注意cout出-1的位置,如果是在if下面,即意味着单次判断无x即直接-1,而实际上应该是全部遍历后再判断。注意事项:参考代码:#include<iostream> using names…… 题解列表 2024年12月10日 0 点赞 0 评论 417 浏览 评分:0.0 C语言 指针解决问题 练手 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main ( ){ int n=0 ,x=0 ,record=1 ; int a[10500]={0} ; …… 题解列表 2024年12月09日 0 点赞 0 评论 465 浏览 评分:0.0 2901:查找特定的值——遍历 摘要:解题思路: 给了n个数,需要从中找值为x的数的下标。 因此可以设定一个数组a,用来存放这n个数。 然后遍历数组a,寻找某个下标k,使得 a[k…… 题解列表 2023年01月09日 0 点赞 0 评论 547 浏览 评分:0.0 2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N=1e7;ll a[N…… 题解列表 2024年04月21日 0 点赞 0 评论 526 浏览 评分:0.0 编写题解 2901: 查找特定的值 摘要:解题思路:#include <bits/stdc++.h>using namespace std;int a,b,d;int c[1000000];int main(){ int sum=1; …… 题解列表 2024年04月21日 0 点赞 0 评论 608 浏览 评分:0.0 2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N=1e7;ll a[N…… 题解列表 2024年04月21日 0 点赞 0 评论 449 浏览 评分:0.0 « 12345 »
查找特定的值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; int a[10000]={0}; int i=0; int m; scanf("%d",&n);…… 题解列表 2022年10月26日 0 点赞 0 评论 497 浏览 评分:0.0
查找特定的值解法:数据结构顺序表解法。在一个序列(下标从1开始)中查找一个给定的值,输出第一次出现的位置。 解题思路:因为最近学习数据结构,就用数据结构的顺序表来解题,基本想法就是使用顺序表的模板来进行增删改查的操作。显然这里只涉及到插入元素和寻找元素两个操作,至于容量扩增的问题在目前这个题里并不需要,因为使用的capacity也算是刚刚好。注意事项:参考代码:////Createdby29714on25- 题解列表 2025年09月02日 0 点赞 0 评论 631 浏览 评分:0.0
2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,m; scanf("%d",&n);//输入 int arr[10001]={0}…… 题解列表 2022年11月17日 0 点赞 0 评论 492 浏览 评分:0.0
全部遍历后再输出-1 摘要:解题思路:注意cout出-1的位置,如果是在if下面,即意味着单次判断无x即直接-1,而实际上应该是全部遍历后再判断。注意事项:参考代码:#include<iostream> using names…… 题解列表 2024年12月10日 0 点赞 0 评论 417 浏览 评分:0.0
C语言 指针解决问题 练手 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main ( ){ int n=0 ,x=0 ,record=1 ; int a[10500]={0} ; …… 题解列表 2024年12月09日 0 点赞 0 评论 465 浏览 评分:0.0
2901:查找特定的值——遍历 摘要:解题思路: 给了n个数,需要从中找值为x的数的下标。 因此可以设定一个数组a,用来存放这n个数。 然后遍历数组a,寻找某个下标k,使得 a[k…… 题解列表 2023年01月09日 0 点赞 0 评论 547 浏览 评分:0.0
2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N=1e7;ll a[N…… 题解列表 2024年04月21日 0 点赞 0 评论 526 浏览 评分:0.0
编写题解 2901: 查找特定的值 摘要:解题思路:#include <bits/stdc++.h>using namespace std;int a,b,d;int c[1000000];int main(){ int sum=1; …… 题解列表 2024年04月21日 0 点赞 0 评论 608 浏览 评分:0.0
2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N=1e7;ll a[N…… 题解列表 2024年04月21日 0 点赞 0 评论 449 浏览 评分:0.0