C++插入加密,替代加密

void 插入加密()
{//缘由https://bbs.csdn.net/topics/396047473
	int n = 1, j = 0;
	char aa[60]{}, aaa[] = "abcde";
	cin >> aa;
	while (j < 60 && (aa[j] - '\0'))cout << aa[j] << aaa[j++ % 5];
}

C++插入加密,替代加密_第1张图片

void 插入加密()
{//缘由https://bbs.csdn.net/topics/396047473
	int n = 2, j = 0, jj = 0;
	char aa[60]{}, aaa[] = "abcde";
	cin >> n >> aa;
	while (j < 60 && (aa[j] - '\0'))if (++j%n)cout << aa[j - 1]; else cout << aa[j - 1] << aaa[jj++ % 5];
	if (j%n)cout << aaa[jj++ % 5];
}

C++插入加密,替代加密_第2张图片

	char c1[11]{};;//缘由https://bbs.bccn.net/redirect.php?tid=499626&goto=lastpost#lastpost
	int j = 0, t = 4;
	printf("输入位数、字符串:");
	scanf_s("%d", &t);
	while (scanf_s("%c", &c1[j]))if (c1[j] == '\n')break; else c1[j] = ((c1[j++] - '0') + t) + '0';
	j = 1; while ((c1[j] - '\0') != '\n')printf("%c", c1[j++]);

 C++插入加密,替代加密_第3张图片

你可能感兴趣的:(c++,开发语言)