# 10์ฅ Mini Project ๋ฌธ์ ํ์ด
409p_Mini Project)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char plain_text[30] = "";
int encrypt_key = 0;
printf("ํ๋ฌธ: ");
gets_s(plain_text, 30);
printf("\n์ํธํ ํค: ");
scanf_s("%d", &encrypt_key);
int leng = strlen(plain_text);
int i = 0;
while (1)
{
if (plain_text[i] == '\0')
{
if (i > leng)
{
break;
}
else
{
plain_text[i] == '\0';
}
}
else
{
if (plain_text[i] >= 'A' && plain_text[i] <= 'z')
{
plain_text[i] += encrypt_key;
if (plain_text[i] > 'z')
{
plain_text[i] -= 26;
}
}
}
i++;
}
printf("\n์ํธ๋ฌธ: %s\n", plain_text);
return 0;
}
410p_Mini Project)
#include <stdio.h>
#include <string.h>
int main()
{
int cnt = 0;
char arr[100];
printf("๋ฌธ์์ด์ ์
๋ ฅํ์์ค: ");
gets_s(arr, 100);
for (int i = 0; i < strlen(arr); i++)
{
cnt++;
if (arr[i] != arr[i + 1])
{
printf("%c%d", arr[i], cnt);
cnt = 0;
}
}
return 0;
}