Commit c2313242 authored by elijah vasquez's avatar elijah vasquez 🦍

I DID IT

parent dbeaad87
// Task 9
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
enum alphaBet{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z};
int main(){
char *morseCode[] = {
int main()
{
char morseCode[26][6] = {
".-", //A
"-...", //B
"-.-.", //C
......@@ -33,15 +34,23 @@ int main(){
"-.--", //Y
"--..", //Z
};
char keyInput[50];
//enum alphaBet keyInput;
char keyInput[1000];
size_t i = 0;
printf("Enter string: ");
scanf("%s", keyInput);
printf("\ndecoded: %s", keyInput);
for (int i = 0; i < 26; i++){
printf("%s\n", morseCode[i]);
}
gets(keyInput);
return 0;
while (keyInput[i] != '\0')
{
if(keyInput[i] != ' ')
{
printf("%s\n", morseCode[tolower(keyInput[i] - 97)]);
}
if(keyInput[i] == ' ')
{
printf(" \n");
}
i++;
}
return 0;
}
No preview for this file type
enum engAlphabet {a,};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment