现在这是真正的代码,如果我输入数字 1009,我希望输出数字是 7687,现在这不是问题所在。在我输入 encryptnum 的最后一个 cout 语句中,我希望它输出 7687 所以我不必输入 cout << first << second << third << Fourth;
#include <iostream>
using namespace std;
int main()
{
int num;
int first;
int second;
int third;
int fourth;
int encryptnum;
cout << " Enter a four digit number to encrypt ";
cin >> num;
first = num % 100 / 10;
second = num % 10;
third = num % 10000 / 1000;
fourth = num % 1000 / 100;
first = (first + 7) % 10;
second = (second + 7) % 10;
third = (third + 7) % 10;
fourth = (fourth + 7) % 10;
encryptnum = //I want to make encryptnum print out first, second, third, and fourth
cout << " Encrypted Number " << encryptnum;
return 0;
}