Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- int i, n;
- float x, k1=0,k2=0,k3=0;
- setlocale(0, "rus");
- cout<<"Введите кол-во чисел"<<endl;
- cin>>n;
- for (i = 1; i <= n; i++)
- {
- cout << "Введите число" << endl;
- cin >> x;
- if (x<0)
- k1++;
- if (x==0)
- k2++;
- if (x>0)
- k3++;
- }
- cout<<"Кол-во отрицательных чисел= "<<k1<<"\tКол-во нулевых чисел= "<<k2<<"\tКол-во положительных чисел= "<<k3<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement