From 4bea7d22311753c11e48e502990e0ff89a8dda72 Mon Sep 17 00:00:00 2001 From: Ayushman Bhattacharya <74301576+Circuit-Overtime@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:18:58 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index de0fe62..d507e21 100644 --- a/README.md +++ b/README.md @@ -73,3 +73,4 @@ To successfully complete the activity, attendees must perform the following step - Run the main.cpp & note down the secret message. - The branch name must match your roll number. - The pull request must not have merge conflicts with the main branch. +- Upload the noted secret message at this form https://forms.gle/vZUjYQtQkCQYieu78 for your attendance. From 885da44a3ae14433b06f603131467a414fc548cd Mon Sep 17 00:00:00 2001 From: Ayushman Bhattacharya <74301576+Circuit-Overtime@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:24:50 +0530 Subject: [PATCH 2/2] Create main.cpp --- main.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 main.cpp diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..ae310e8 --- /dev/null +++ b/main.cpp @@ -0,0 +1,40 @@ +#include +using namespace std; + +void author_list() { + // contributor list + string contributor_names[] = { "Manish", "Ayushman" };// add your name here + int cnt = sizeof(contributor_names) / sizeof(contributor_names[0]); + + cout << "\n\n-:: Authors ::-\n"; + for (int i = 0; i < cnt; i++) { + cout << " "; + for (char c : contributor_names[i]) { + cout << c; + } + cout << endl; + } +} + +void secret_message(const char* encoded, int key) { + int len = strlen(encoded); + char decoded[len + 1]; // initalising char array + + for (int i = 0; i < len; i++) { + decoded[i] = encoded[i] ^ key; + } + decoded[len] = '\0'; // null termination marks end of string + + printf("Secret Message: %s\n", decoded); +} + +int main() { + const char encoded_message[] = { 'K', 'C', 'D', 'C', 'M', 'V', 'N', 'C', 'Q', 'J', '\0' }; + int key = 42; + + printf("Decoding secret message...\n"); + secret_message(encoded_message, key); + author_list(); + + return 0; +}