c++定义一个有10个元素的整型一维数组,统计输出数组中所有奇数元素在数组中的位置序号用指针的方法?

2025-04-15 05:01:18
推荐回答(1个)
回答1:

#include
using namespace std;
int a[100];
int main(){
int x,n = 0;
while(cin>>x==1){
a[n++]=x;//相当于a[n]=x;n++;
}
for(int i = n-1;i>=1;--i){
cout< }
cout< return 0;
}
【答题不易,请采纳谢谢】