题解 2901: 查找特定的值

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

编写题解 2901: 查找特定的值

摘要:解题思路: 1、创建三个变量(int n输入个数,m目标 bool z用于判断是否有目标数=false) 2、创建一个数组a[10001] 3、输入输入个数变量n 4、循环输入a数组的第i项 5、输入……

2901: 查找特定的值

摘要:参考代码:#include <bits/stdc++.h>using namespace std;int a,b,d;int c[1000000];int main(){    int sum=1; ……

编写题解 2901: 查找特定的值

摘要:解题思路:输入-判断-输出注意事项:第一次出现字符参考代码:#include<stdio.h>int main(){    int n,x,i;    scanf("%d\n",&n);    int……

2901: 查找特定的值

摘要:```cpp #include #include using namespace std; int main() { int m,n,a[10000],i=0; mems……

2901: 查找特定的值

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>typedef long long ll;const int N=1e7;ll a[N];using namespace s……

查找特定的值C解

摘要:解题思路:注意事项:注意看题参考代码:#include<stdio.h>int main(){    int n,a[10000],i,m,count=0;    scanf("%d",&n);   ……

查找特定的值解法:数据结构顺序表解法。在一个序列(下标从1开始)中查找一个给定的值,输出第一次出现的位置。

摘要:解题思路:因为最近学习数据结构,就用数据结构的顺序表来解题,基本想法就是使用顺序表的模板来进行增删改查的操作。显然这里只涉及到插入元素和寻找元素两个操作,至于容量扩增的问题在目前这个题里并不需要,因为……

小白题解 2901: 查找特定的值

摘要:解题思路:原本以为使用字符串可以解决了呢,没想到现实给我了一个大逼斗 无奈至极注意事项:参考代码:n = input()li = input().split()s = input()if s in l……

全部遍历后再输出-1

摘要:解题思路:注意cout出-1的位置,如果是在if下面,即意味着单次判断无x即直接-1,而实际上应该是全部遍历后再判断。注意事项:参考代码:#include<iostream> using names……

C语言 指针解决问题 练手

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main  ( ){     int n=0 ,x=0 ,record=1 ;     int a[10500]={0} ;  ……