查找整数
来源:互联网 发布:樱井知香种子9部密码 编辑:程序博客网 时间:2024/06/03 21:58
import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner scan=new Scanner(System.in);int n=scan.nextInt();int [] arr=new int[n];for(int i=0;i<n;i++){arr[i]=scan.nextInt();}int num=scan.nextInt();for(int i=0;i<n;i++){if(num==arr[i]){System.out.println(i+1);break;}else if(i==n-1){System.out.println(-1);}}}}
阅读全文
0 0
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- 查找整数
- zookeeper集群的搭建及介绍
- 使用dropwizard(3)-加入DI-dagger2
- 自顶向下,逐步求精
- 两种使用ListView的方法
- Liunx(八)
- 查找整数
- 函数模板
- Mac Vue.js 安装并初始化项目
- 在Django中自定义filter并在template中使用
- Aras innovator: TOC目录简单汉化方法
- 使用dropwizard(4)-加入测试-jacoco代码覆盖率
- 11.25作业(ZLY)
- 顺时针打印矩阵
- 网络原理,以及对VMware Workstation虚拟网络VMnet0、VMnet1、VMnet8的图解