int digit;
cout << "Enter digit:";
cin >> digit;
if (digit > 100000)
{
system("pause");
cout << "Enter digit:";
cin >> digit;
if (digit > 100000)
cout << "Error! Wrong number!" << endl;else
{
int correct = true;}
int tmp;
tmp = digit % 10;
if (tmp == 1 || tmp == 3 || tmp == 5 || tmp == 7)
{
digit /= 10;}
tmp = digit % 10;
if (tmp == 1 || tmp == 3 || tmp == 5 || tmp == 7)
{
digit /= 10;}
tmp = digit % 10;
if (tmp == 1 || tmp == 3 || tmp == 5 || tmp == 7)
{
digit /= 10;}
tmp = digit % 10;
if (tmp == 1 || tmp == 3 || tmp == 5 || tmp == 7)
{
digit /= 10;}
tmp = digit % 10;
if (tmp == 1 || tmp == 3 || tmp == 5 || tmp == 7)
{
correct = false;}
cout << ((correct) ? "Not simple digits of number" : "Simple digits of number") << endl;
system("pause");
Комментариев нет:
Отправить комментарий