pa-03
This commit is contained in:
13
pa-03/a3/funktionen/to_ascii.c
Normal file
13
pa-03/a3/funktionen/to_ascii.c
Normal file
@@ -0,0 +1,13 @@
|
||||
int to_ascii(char c) {
|
||||
if (c >= 'A' && c <= 'Z') {
|
||||
int ascii_A = 65;
|
||||
int off = ascii_A - 'A';
|
||||
return c + off;
|
||||
}
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
int ascii_a = 97;
|
||||
int off = ascii_a - 'a';
|
||||
return c + off;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
1
pa-03/a3/funktionen/to_ascii.h
Normal file
1
pa-03/a3/funktionen/to_ascii.h
Normal file
@@ -0,0 +1 @@
|
||||
int to_ascii(char c);
|
||||
4
pa-03/a3/funktionen/to_upper_case.c
Normal file
4
pa-03/a3/funktionen/to_upper_case.c
Normal file
@@ -0,0 +1,4 @@
|
||||
int to_upper_case(char c) {
|
||||
if (c >= 'A' && c <= 'Z') return c;
|
||||
return c - ('a' - 'A');
|
||||
}
|
||||
1
pa-03/a3/funktionen/to_upper_case.h
Normal file
1
pa-03/a3/funktionen/to_upper_case.h
Normal file
@@ -0,0 +1 @@
|
||||
int to_upper_case(char c);
|
||||
Reference in New Issue
Block a user