Skip to content

Instantly share code, notes, and snippets.

@chomado
Created April 29, 2014 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chomado/11403109 to your computer and use it in GitHub Desktop.
Save chomado/11403109 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int check(char c)
{
if ('A'<= c && c <='Z') return 1;
else if ('a'<=c && c<='z') return 0;
else return 2;
}
/** メイン関数 **/
int main(void)
{
char c;
while (scanf("%c", &c), c != '\n')
printf("%c", (check(c)==1) ? c+' ' : (check(c)?c:c-' '));
putchar('\n');
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment