Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Gilbert Zhuo z5311591
- //30/3/2020
- #include <stdio.h>
- #include <ctype.h>
- int main (void) {
- char sub[26];
- for(int i = 0; i < 26; i++) {
- sub[i] = getchar();
- }
- int ch = getchar();
- while(ch != EOF) {
- //Lower case
- if (ch >= 97 && ch <= 122) {
- printf("%c",sub[ch-97]);
- }
- //Upper Case
- else if (ch >= 65 && ch <= 90) {
- printf("%c",toupper(sub[ch-65]));
- }
- else {
- printf("%c", ch);
- }
- ch = getchar();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement