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;
- char an;
- setlocale(0, "rus");
- do
- {
- cout << "Введите число" << endl;
- cin >> x;
- if (x<0)
- k1++;
- if (x==0)
- k2++;
- if (x>0)
- k3++;
- cout<<"Будете еще вводить? (Y or N)"<<endl;
- cin>>an;
- }while(an=='Y');
- cout<<"Кол-во отрицательных чисел= "<<k1<<"\tКол-во нулевых чисел= "<<k2<<"\tКол-во положительных чисел= "<<k3<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment