Codeforces IOtest
来源:互联网 发布:网络胜利组风车动漫 编辑:程序博客网 时间:2024/05/17 21:54
题目链接:http://codeforces.com/problemset/problem/25/A
import java.util.Scanner;public class IQtest {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int n = scanner.nextInt();int count = 0;int evenIndex = 0;int oddIndex = 0; //奇数较多,就输出偶数的位置,偶数较多就输出奇数的位置for(int i =1 ;i <= n;i++) {int temp = scanner.nextInt();if(temp % 2 == 0) {count++;evenIndex = i;} else {count--;oddIndex = i;}}System.out.println(count > 0 ? oddIndex : evenIndex);}}
阅读全文
0 0
- Codeforces IOtest
- IOTest
- 温故而知新,轮子iotest
- 黑马程序员 java基础IOTest
- IOTest把登录信息保存,下次打开自动读取保存的登录信息,无需再次输入
- IOTest把输入的信息,保存到本地,按读取按钮将其读取出来
- codeforces~~~
- Codeforces
- codeforces
- Codeforces
- codeforces
- codeforces
- Codeforces
- Codeforces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- 用户登录后更换会话ID
- 【Python】Python数据分析基础技术03
- ViewPager切换动画
- Entity Framework Repository模式
- 2017年暑期全国高校教师 “Python编程及应用”培训班通知
- Codeforces IOtest
- 初学c++之链表基本操作
- 一个屌丝程序猿的人生(七)
- Node.js 中 source map 使用问题总结
- java的switch表达式支持的类型
- jQuery Ajax 实例 ($.ajax、$.post、$.get)
- 生成对抗网络
- 微信支付接入流程——刷卡支付接入
- 波浪控件