The string input and output should be the simplest problem, but if you can use a few tips to improve the efficiency of the Code, or to summarize the next
The meaning of the following code is probably the input sentence dislocation of the time to restore the original sentence. For example, input "O S, gomr" Output "I AM FINE";
#include <stdio.h>intMain () {Chars[]="' 1234567890-=qwertyuiop[]\asdfghjkl; ' zxcvbnm,./"; inti; CharC; while((C=getchar ())! =EOF) { for(i=1; s[i]&&s[i]!=c;i++); { if(S[i]) Putchar (s[i-1]); ElsePutchar (c); } } return 0;}
The following code is simple, replacing a character with a character, with the emphasis on using this method
#include <stdio.h>intMain () {intc,q=1; while((C=getchar ())! =EOF) { if(c=='"') {printf ("%s"Q?""'":""'"); Q=!Q; } Elseprintf ("%c", c); } printf ("%d",'''); return 0;}
string input and Output