kmitl-profund-exercise/string-case-swapper-alt/main.cpp

21 lines
356 B
C++

#include<iostream>
#include<stdio.h>
int main() {
char i[50],*k;
printf("Input: ");
scanf("%s", i);
k=i;
while(*k!='\0'){
if(*k>=97&&*k<=122){
*k=*k-32;
}
else if(*k>=65&&*k<=90){
*k=*k+32;
}
k++;
}
printf("Output: ");
printf("%s\n", i);
return 0;
}