Home > Back-end > C language contest questions how to solve
C language contest questions how to solve
Time:11-28
A very simple question, the question how to write, characters of knowledge completely forget, I remember STRCHR is used to write, but didn't write out good intention person to help me
CodePudding user response:
No man or woman??
CodePudding user response:
This didn't also difficult, write their own good? Too lazy.
CodePudding user response:
Show a, only supplies the reference:
# include & lt; stdio.h> # include & lt; string.h>
Int yes_or_no (int) c { int result=0; If (c=='a' | | c=='e' | | c=='I' | | c=='o' | | c=='u') result=1; Else if (c=='A' | | c=='E' | | c=='I' | | c=='O' | | c=='U') result=1; return result; }
Int main (void) { Char buf [1001]. Char * p;
While (the fgets (buf, sizeof (buf), stdin)) { If (STRCMP (buf, "end \ n")==0 | | STRCMP (buf, "end of \ r \ n")==0) break;
P=buf. While (* p!='\ 0') { If (yes_or_no (* p)==1) printf (" % c ", * p); p++; } printf("\n"); }