Array-05. String Letter case conversion (10) time limit MS Memory limit 65536 KB code length limit 8000 B procedure StandardAuthor Zhang Tong Hongyu (Zhejiang University)
Enter a string ending with #, which requires all lowercase letters to be converted to uppercase letters, all uppercase and lowercase, and the other characters unchanged.
Input format:
The input gives a non-empty string that has a length of not more than 40, ending in #, in a row.
Output format:
Output the converted string as required on a single line.
Input Sample:
Hello world! 123#
Sample output:
HELLO world! 123
1#include <stdio.h>2#include <math.h>3#include <stdlib.h>4#include <string.h>5 intMain ()6 {7 Charstr[ -];8 gets (str);9 inti;Ten for(i =0; I < strlen (str); i++) One { A if(Str[i] >='a'&& Str[i] <='Z') -Str[i] = Str[i] +'A'-'a'; - Else if(Str[i] >='A'&& Str[i] <='Z') theStr[i] = Str[i] +'a'-'A'; - } - for(i =0; Str[i]! ='#'; i++) - { +printf"%c", Str[i]); - } +printf"\ n"); A return 0; at}
Array-05. String Letter Case Conversion