题解 | 小红取数
小红取数
https://www.nowcoder.com/practice/4391bfcde97f4220a63b43a645945e61
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,cnt=0;
cin>>n;
while(n--){
int a;
cin>>a;
if(a%2==1)cnt++;
}
if(cnt==0)cout<<-1;
else cout<<cnt;
return 0;
}
// 64 位输出请用 printf("%lld")
