?>
Обозначим через ДЕЛ (n, m) утверждение «натуральное число n делится без остатка на натуральное число m». Для какого наибольшего натурального числа A формула (ДЕЛ(90, A) /\ (¬ДЕЛ(x, A) → (ДЕЛ(x, 15) → ¬ДЕЛ(x, 20))) тождественно истинна, то есть принимает значение 1 при любом натуральном x?
Ответы
#include <iostream>
using namespace std;
int main() {
// Variables
int number;
bool isPositive = false;
int numberCountDigits = 0;
// Input data
cout << "Input nubmer" << endl;
cin >> number;
// Create Solution
if (number > 999 || number < -999) {
cout << "Incorrect number" << endl;
return 0;
}
if (number >= 0) {
isPositive = true;
}
while (number != 0) {
numberCountDigits++;
number /= 10;
}
// Output Solution
cout << "-- Information --" << endl;
isPositive ? cout << "Is Positive number" << endl : cout << "Is Negative number" << endl;
cout << "Digits count: " << numberCountDigits << endl;
return 0;
}