t05-ul.c
#include <stdio.h> #include <stdlib.h> int main(void) { int x = getchar(); if (x == 'u') { while (1) { int c = getchar(); if (c == EOF) { break; } if (c >= 'a' && c <= 'z') { c -= 32; } printf("%c", c); } } if (x == 'l') { while (1) { int c = getchar(); if (c == EOF) { break; } if (c >= 'A' && c <= 'Z') { c += 32; } printf("%c", c); } } }