#include <iostream>
int encrypt(int number) {
int n1 = number % 10;
n1 += 7;
n1 %= 10;
int n2 = number / 10 % 10;
n2 += 7;
n2 %= 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
Very useful
Leave a comment