Skip to content

Commit

Permalink
モールス変換の基盤となるアルファベット、数字、ドットのみを出力するコードを作成した
Browse files Browse the repository at this point in the history
  • Loading branch information
wada-jun8 committed Nov 26, 2024
1 parent 8daf0ce commit 46518cd
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions morse.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2024 Junya Wada
// SPDX-License-Identifier: GPL-3.0-only

#include <stdio.h>
#include <ctype.h>

int main(){
char c;

while(1){
printf("PRESE ENTER THE TEXT:\n");

while((c = getchar()) != '\n'){
if(isalpha(c)){
c = tolower(c);
printf("%c",c);
}
if(isdigit(c) || c == '.'){
printf("%c",c);
}
}
printf("\n");
}
return 0;
}

0 comments on commit 46518cd

Please sign in to comment.