设为首页
收藏本站
开启辅助访问
切换到窄版
登录
立即注册
中问网首页
我的收藏
站长博客
搜索
搜索
本版
帖子
用户
第一问答网
»
论坛
›
中问网
›
问答
›
求救!如何用c++罗列一个一维数组 把所有的偶数元素输出 ...
返回列表
发新帖
求救!如何用c++罗列一个一维数组 把所有的偶数元素输出
[复制链接]
11
|
2
|
2008-12-8 07:33:45
|
显示全部楼层
|
阅读模式
要求数组元素可以随意输入 并把其中的偶数元素输出
回复
使用道具
举报
千问
|
2008-12-8 07:33:45
|
显示全部楼层
int a[100]={0};for(int i=0;i>a;if(a
%2==0){cout#include using namespace std;int main(){ vector
intArray; string str; cout<<"输入数字或end结束输入数字:"<<endl; while(...
回复
使用道具
举报
千问
|
2008-12-8 07:33:45
|
显示全部楼层
先提示输入一个最大值,然后分配空间。循环用来检测不同数值,输入0退出。main(){int max,i,*arr;while(1){printf("\nEnter the max numer:");scanf("%d",&max);getchar();if(max==0)break;for(i=2;i<=max;i++){...
回复
使用道具
举报
返回列表
发新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
千问
主题
0
回帖
4882万
积分
论坛元老
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
积分
48824836
加好友
发消息
回复楼主
返回列表
问答
热门排行