题目1052:找x
来源:互联网 发布:java中public private 编辑:程序博客网 时间:2024/05/04 13:49
#include <iostream>#include <stdio.h>#include <algorithm>#include <math.h>#include <string>#include <string.h>#include <vector>using namespace std;//1052 找xint num[201];int main(){ int n,x; while(scanf("%d",&n)!=EOF){ for(int i=0;i<n;i++) scanf("%d",num+i); scanf("%d",&x); bool flag=false; for(int i=0;i<n;i++){ if(x==num[i]){ printf("%d\n",i); flag=true; break; } } if(!flag) printf("%d\n",-1); } return 0;}/************************************************************** Problem: 1052 User: cust123 Language: C++ Result: Accepted Time:0 ms Memory:1520 kb****************************************************************/
0 0
- 题目1052:找x
- 题目1052:找x
- 题目1052:找x
- 题目1052:找x
- 题目1052:找x
- 题目1052:找x
- 题目 1052 找x
- 题目1052:找x
- 题目1052:找x
- 题目1052:找x
- 17-题目1052:找x
- 九度题目1052:找x
- 九度 题目1052:找x
- 【九度】题目1052:找x
- 九度OJ题目1052:找x
- 九度OJ题目1052:找x
- 题目17:找x
- 题目1122: 找x
- C实现C++类
- TS学习资料
- JavaOOP IO 带缓冲区
- 一、 ubuntu 14.04 的前期软件准备(定期更新)
- ToolTip插件,鼠标悬停时显示信息
- 题目1052:找x
- 区间dp+ 滚动数组uva1632
- 将excel中多行多列数据处理成多行双列
- 微信开卡部分JS代码废弃备份
- centos 安装 vsftpd
- 从request获取各种路径总结 request.getRealPath("url"); // 虚拟目录映射为实际目录 request.getRealPat
- android studio报错之unKnownHost
- JavaOOP IO 带二进制 的 读取和写入方法
- java方法栈测试