Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int A;
- cout << ("Введите A = ");
- while (!(cin >> A) || (cin.peek() != '\n'))
- {
- cin.clear();
- while (cin.get() != '\n');
- cout << ("Введите целое число: ");
- }
- if (A < 2) {
- cout << "F(A) = " << A;
- }
- else if (A >= 2 && A <= 3) {
- cout << "F(A) = " << 2;
- }
- else {
- cout << "F(A) = " << - A + 5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement