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 BirthdayNumber, BirthdayMonth, BirthdayYear;
- int NumberOne, NumberTwo, NumberThree;
- cout << "Введите день своего рождения: ";
- cin >> BirthdayNumber;
- if (BirthdayNumber > 22 && BirthdayNumber <= 31) {
- NumberOne = (BirthdayNumber / 1) % 10 + (BirthdayNumber / 10) % 10;
- cout << "Число 1: " << NumberOne << endl;
- }
- else {
- if (BirthdayNumber > 0 && BirthdayNumber <= 22) {
- NumberOne = BirthdayNumber;
- cout << "Число 1: " << BirthdayNumber << endl;
- }
- else {
- cout << "Вы ввели неправильное число. Оно должно быть в диапазоне от 1 до 31." << endl;
- }
- }
- cout << "Введите порядковый номер своего месяца рождения: ";
- cin >> BirthdayMonth;
- if (BirthdayMonth > 0 && BirthdayMonth <= 12) {
- NumberTwo = BirthdayMonth;
- cout << "Число 2: " << NumberTwo << endl;
- }
- else {
- cout << "Вы ввели неправильное число. Оно должно быть в диапазоне от 1 до 12." << endl;
- }
- cout << "Введите год своего рождения: ";
- cin >> BirthdayYear;
- if (BirthdayYear > 999 && BirthdayYear < 10000) {
- NumberThree = (BirthdayYear / 1) % 10 + (BirthdayYear / 10) % 10 + (BirthdayYear / 100) % 10 + (BirthdayYear / 1000) % 10;
- if (NumberThree > 22) {
- cout << "Число 3: " << (NumberThree / 1) % 10 + (NumberThree / 10) % 10 << endl;
- }
- else {
- if (NumberThree > 0 && NumberThree <= 22) {
- cout << "Число 3: " << NumberThree << endl;
- }
- }
- }
- int NumberFour = NumberOne + NumberTwo;
- if (NumberFour > 22) {
- NumberFour = (NumberFour / 1) % 10 + (NumberFour / 10) % 10;
- cout << "Число 4: " << NumberFour << endl;
- }
- else {
- cout << "Число 4: " << NumberFour << endl;
- }
- int NumberFive;
- if (NumberThree > 10) {
- NumberFive = (NumberThree / 1) % 10 + (NumberThree / 10) % 10;
- cout << "Число 5: " << NumberFive << endl;
- }
- else {
- if (NumberThree > 0 && NumberThree <= 10) {
- NumberFive = NumberThree;
- cout << "Число 5: " << NumberFive << endl;
- }
- }
- int NumberSix = NumberFour + NumberFive;
- if (NumberSix > 22) {
- NumberSix = (NumberSix / 1) % 10 + (NumberSix / 10) % 10;
- cout << "Число 6: " << NumberSix << endl;
- cout << "Ваш Аркан судьбы: " << NumberSix << endl;
- }
- else {
- if (NumberSix <= 22) {
- NumberSix = NumberFour + NumberFive;
- cout << "Число 6: " << NumberSix << endl;
- cout << "Ваш Аркан судьбы: " << NumberSix << endl;
- }
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment