Codeforces 25A IQ test
来源:互联网 发布:php pack 16进制 编辑:程序博客网 时间:2024/04/30 07:10
题目:http://codeforces.com/problemset/problem/25/A
代码:
#include<stdio.h>#include<string.h><span style="white-space:pre"></span>//还真是IQ测试using namespace std;int main(){ int t; scanf("%d",&t); int a[105]; int n,m,j=0,k=0; for(int i=0;i<t;i++) { scanf("%d",&a[i]); if(a[i]%2==0&&j==0) { n=i; j=1; } if(a[i]%2==1&&k==0) { m=i; k=1; } } for(int i=0;i<t;i++) { if(i==n||i==m)continue; if(a[i]%2==0) { printf("%d\n",m+1); break; } else { printf("%d\n",n+1); break; } }}
0 0
- Codeforces 25A IQ test
- 【CodeForces】[25A]IQ test
- CodeForces 25A IQ test 唯一奇偶
- codeforces 328A. IQ Test
- codeforces A. IQ test 题解
- codeforces-25A-A. IQ test( C && 怡宝 )
- Codeforces Beta Round #25 (Div. 2)--A. IQ test
- CodeForces 25A IQ test 唯一奇偶(简单的题目)
- codeforces——25A——IQ test
- CodeForces Testing Round #8 A.IQ Test
- Codeforces-287a C IQ Test
- Codeforces 328A-IQ Test(数列)
- 【水模拟】#25 A. IQ test
- Codeforces Testing Round #8 / 328A IQ Test(模拟)
- A. IQ test
- A. IQ Test
- A. IQ test
- IQ Test
- App版本更新时对SQLite数据库升级或者降级遇到的问题
- ios 计时lable
- ACM-JAVA-1001-A+B
- TextView(文本框)详解
- php,is_null 和==null为何结果不同?
- Codeforces 25A IQ test
- 买卖时机APP 开启股票交易大数据时代!
- 函数返回多个值
- Weblogic构建jms服务
- Windows版本编译运行React Native官方实例UIExplorer项目
- 冬眠结束,醒醒吧
- POJ3278 爆搜,不要像我一样作死就好
- LeetCode Bulls and Cows
- Unsupported major.minor version (jdk版本错误)