编写题解 2901: 查找特定的值 摘要:解题思路: 1、创建三个变量(int n输入个数,m目标 bool z用于判断是否有目标数=false) 2、创建一个数组a[10001] 3、输入输入个数变量n 4、循环输入a数组的第i项 5、输入…… 题解列表 2023年07月13日 1 点赞 0 评论 658 浏览 评分:9.9
c语言简单解法 解题思路:利用数组求解,利用break用来使循环终止从而达到前面的i先输出,提前设输出变量=-1,若符合则变量=i+1,避免if多次判断注意事项:不要把赋值和等于号混淆,数组下标从0开始参考代码:#includeintmain(){intn, 题解列表 2023年12月07日 0 点赞 0 评论 568 浏览 评分:9.9
2901: 查找特定的值 摘要:参考代码:#include <bits/stdc++.h>using namespace std;int a,b,d;int c[1000000];int main(){ int sum=1; …… 题解列表 2023年07月18日 0 点赞 0 评论 498 浏览 评分:9.9
查找特定的值(c语言代码) 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <string.h> int main() { int n = 0, i = 0, x = 0…… 题解列表 2023年11月11日 0 点赞 0 评论 661 浏览 评分:9.9
编写题解 2901: 查找特定的值 摘要:解题思路:输入-判断-输出注意事项:第一次出现字符参考代码:#include<stdio.h>int main(){ int n,x,i; scanf("%d\n",&n); int…… 题解列表 2022年10月21日 0 点赞 1 评论 1266 浏览 评分:8.0
2901: 查找特定的值 ```cpp#include#includeusingnamespacestd;intmain(){intm,n,a[10000],i=0;memset(a,0,sizeof(a));cin>>n;for(i=0;i>a[i];cin>>m;for(i=0;i 题解列表 2022年11月30日 0 点赞 0 评论 597 浏览 评分:8.0
2901: 查找特定的值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>typedef long long ll;const int N=1e7;ll a[N];using namespace s…… 题解列表 2024年04月20日 0 点赞 0 评论 450 浏览 评分:2.0
小白题解 2901: 查找特定的值 解题思路:原本以为使用字符串可以解决了呢,没想到现实给我了一个大逼斗无奈至极注意事项:参考代码:n=input()li=input().split()s=input()ifsinli:print(li.index(s)+1)else:print(-1) 题解列表 2022年09月25日 0 点赞 0 评论 885 浏览 评分:0.0
2901: 查找特定的值(C语言) 摘要: #include #include int main() { int n; scanf("%d",&n); int a[n+1]; for(int i=1…… 题解列表 2023年07月24日 0 点赞 0 评论 532 浏览 评分:0.0
Py2901-查找特定的值 摘要:n=int(input())m=list(map(int,input().split()))l=int(in…… 题解列表 2025年12月10日 0 点赞 0 评论 292 浏览 评分:0.0