#include <iostream>
int encrypt(int number) {
int n1 = (number % 10 + 7) % 10;
int n2 = (number / 10 % 10 + 7) % 10;
int encrypted = n1 * 10 + n2;
return encrypted;
}
int main() {
std::cout << "Enter the number to encrypt: ";
int number;
std::cin >> number;
std::cout << "Encrypted number: " << encrypt(number) << std::endl;
system("pause");
return 0;
}
Comments
Leave a comment