Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(void){
- int i,n1,pos=0,cero=0,neg=0;
- cout<< " Ingrese la cantidad de numeros 10 numeros: "<<endl;
- for (i = 0; i < 10; i++){
- cin>>n1;
- if(n1>0){
- pos++;
- }
- else
- if(n1<0){
- neg++;
- }
- else{
- cero++;
- }
- }
- cout<<"--------------------"<<endl;
- cout << "La cantidad de numeros positivos son: "<<pos<< endl;
- cout<<"--------------------"<<endl;
- cout << "La cantidad de numeros negativos son: "<<neg<< endl;
- cout<<"--------------------"<<endl;
- cout << "La cantidad de numeros positivos son: "<<cero<< endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment