题解 | A30445.输出奇数和偶数
2025-11-05 14:01:18
发布于:广东
1阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int a[35];
int main(){
for(int i = 1;i <= 30;i++){
cin >> a[i];
}
for(int i = 1;i <= 30;i++){
if(a[i] % 2 != 0){
if(a[i] != 0){
cout << a[i] << " ";
}
}
}
cout << "\n";
for(int i = 1;i <= 30;i++){
if(a[i] % 2 == 0){
if(a[i] != 0){
cout << a[i] << " ";
}
}
}
return 0;
}
这里空空如也


有帮助,赞一个