Home > Back-end >  SOS
SOS

Time:06-04

Statistics a number of some characters in the source string, the string with a single character are defined by the user;
If the source string is: I ate an apple and an orange! String to the an, then the final result is 4;
Anyone who can help it? (I'll single letter output, but how to string output? )

CodePudding user response:

When the output with % s

CodePudding user response:

What do you mean? You this string need input, i.e., how is the output? What do you want to output?

CodePudding user response:

To use substring STRSTR, then shift the location of the source string,
Looking for used STRCHR characters

CodePudding user response:

refer to the second floor SuperDay response:
what do you mean? You this string need input, i.e., how is the output? What do you want to output?

I know, is to enter the I ate an apple and an orange! This sentence how can output "' an ', 4," this? I would only from 26 letters input (such as input a a) first, then the output result is' a ', 2, that is to say, I will be a single character that output, don't see how the output of the string!!

CodePudding user response:

reference 1st floor datoulaile123 response:
output when using % s

When the definition of what will change

CodePudding user response:

This kind of problem is the foundation, please look the book, write the program again better

CodePudding user response:

refer to 6th floor SuperDay response:
this kind of problem is the foundation, please look the book, write the program again better

Emm, my freshman year, just contact with c, textbook is not similar to the output string examples of this class, so to help, has recently been reading and practice application of the book, continue to work hard!

CodePudding user response:

Why not, read a book carefully

CodePudding user response:

refer to the eighth floor SuperDay response:
how could not, carefully read

OK, who said what all of I look again carefully

CodePudding user response:

Don't big bosses, character array is a string, you don't see the leakage

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html