vc++编程求大神,Output Positive Numbers题目描述Please wirte a program to read integers from the keyboard and print all the positive numbers out.Each number is in the scope of the int type.输入格式The input contains two lines.The first lin

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 10:52:30
vc++编程求大神,OutputPositiveNumbers题目描述Pleasewirteaprogramtoreadintegersfromthekeyboardandprintallthepos

vc++编程求大神,Output Positive Numbers题目描述Please wirte a program to read integers from the keyboard and print all the positive numbers out.Each number is in the scope of the int type.输入格式The input contains two lines.The first lin
vc++编程求大神,Output Positive Numbers

题目描述

Please wirte a program to read integers from the keyboard and print all the positive numbers out.Each number is in the scope of the int type.
输入格式

The input contains two lines.The first line is a number that indicates how much numbers to be read.Then the numbers are listed in the second line separated by white spaces.There are no more than 1000 numbers to be read.
输出格式

Print out all the positive numbers in one line and there should be one white space between two numbers.
Note:there should be no white space in the end of the output.
样例输入
3
12 13 -1
样例输出
12 13
我的程序是
#include<iostream>
#include<vector>
using namespace std;
int main()

 vector<int> list;    
 int num;  
 cin>>num;    
 int oj;
 while(num--)    
  {        
    cin>>oj; 
    cout<<" ";      
    list.push_back(oj);
  }    
 for(int k=0;k<list.size();k++)    
  {        
   if(list[k]>0)        
    {            
     cout<<list[k];        
    }        
  }
}  
不知道哪里错了

vc++编程求大神,Output Positive Numbers题目描述Please wirte a program to read integers from the keyboard and print all the positive numbers out.Each number is in the scope of the int type.输入格式The input contains two lines.The first lin
百度搜孙鑫或者黄维通

vc++编程求大神,Output Positive Numbers题目描述Please wirte a program to read integers from the keyboard and print all the positive numbers out.Each number is in the scope of the int type.输入格式The input contains two lines.The first lin 数控铣床编程 求大神编程程序 求大神编程数控铣床 matlab编程问题,求大神帮忙! 求大神做一道编程题 vc++ 编程 求1到599中能被3整除 且各位是5的数 EVE加达里高安还有空闲的POS位置吗?如题,或者求购一个科研小POS,求大神便宜点给一个,新手穷… 给你一个函数表达式,请你编程求它的函数值.(求大神C++)Input 输入有若干行,每行一对n,m的值.0,0表示结束. Ouput 按样例的格式输入计算后的值. Sample Input 1 12 15 43 44 30 0Sample Output f(1,1)=1f(2,1)=2 vc++6.0菜鸟求解题.下面附图结果,请大神们做出这种的. Output 求编一道脑残题从键盘任意输入一个整型n,编程计算n的每一位数字相乘之积.Sample Input 123456789Sample Output 2415120 编程如何编写下列两道题的程序(用C++或VC++6.0)?1,:求两个集合的交集.2:求两个集合的笛卡尔乘积. C语言编程 1、输入四个数,将四个数分别从小到大、从大到小排序后进行输出.VC++ 6.0 求高手赐教 VC++编程:用二分法求方程x*x-2-x=0在[0,3]区间的根.要求误差不大于10负5次方. 输入三角形的三边a、b、c(可以小数),求面积,并输出.如果构不成三角形,给出“data error”的信息提示.用VC编程 求M*N矩阵的所有外侧元素之和.(其中,M和N矩阵为符号常量,数值自定)用VC++6.0进行编程,=. VC 急求C语言编程 求如下分段函数的值求求大神们 跪谢