Casing conversion time limit: 1.0s memory limit: 512.0MBProblem description Write a program, enter a string (not more than 20), and then the string of each character in the case of the transformation, will be uppercase letters into lowercase, lowercase letters into uppercase, and then the new string output.
Input format: Enter a string, and the string contains only English letters, no other types of characters, and no spaces.
Output format: Outputs the converted string.
Input and Output sample sample input Aedb sample output Aedb
Code:
/*************************************************************************> File name:f.cpp> Author:zzuspy > Mail: [email protected] > Created time:2014 December 03 Wednesday 20:04 47 Seconds ********************************************** /#include <cstdio> #include <cstring> #include <iostream> #include < algorithm> #include <cstdlib> #include <cmath> #include <stack> #include <queue> #define LL Long Long#define max3 (a,b,c) max (A,max (b,c)) #define MIN3 (a,b,c) min (a,min (b,c)) using namespace Std;int main () {char a[25 ];SCANF ("%s", a), for (int i=0; a[i]!= '); i++) {if (a[i]>= ' a ' && a[i]<= ' z ') printf ("%c", a[i]-32); else if (a [i]>= ' A ' && a[i]<= ' Z ') printf ("%c", a[i]+32);} return 0;}
Blue Bridge Cup-case conversion (string ~ water)