题解 2901: 查找特定的值

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

筛选

查找特定的值

摘要:解题思路:首先通过scanf获取数据,接着对给定的一串数据,通过数组记录,开始获取的数据即为数组长度,再由这个数组长度来声明数组,并通过循环遍历给数据赋值,至此已经获得了一串代找数据,然后先给一共变量……

2901: 查找特定的值

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

c语言代码解决问题

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

太难了真是要自习看题目

摘要:解题思路:注意事项:参考代码:n=int(input())a=list(map(int,input().split()))x=int(input())for i in range(n):    if ……

2901:查找特定的值——遍历

摘要:解题思路: 给了n个数,需要从中找值为x的数的下标。               因此可以设定一个数组a,用来存放这n个数。               然后遍历数组a,寻找某个下标k,使得  a[k……

C语言 指针解决问题 练手

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

全部遍历后再输出-1

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

2901: 查找特定的值

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int n,m;    scanf("%d",&n);//输入    int arr[10001]={0}……