Home > Back-end >  Judge a paragraph of word is a vowel consonant letter of application, no need to worry about why can
Judge a paragraph of word is a vowel consonant letter of application, no need to worry about why can

Time:09-30

If cin> Ch, that how to automatically remove the string at the back of the Spaces?



#include
#include
#include
/* run this program using the console pauser or add your own getch, system (" pause ") or the input loop */
using namespace std;
Const int SIZE=10;
Int main (int arg c, char * * argv) {
Cout & lt; <"Enter words (q to quit) :" & lt; String ch;
Int vow=0;//vowel word number
Int cons=0;//consonant words number
Int others=0;
Cin & gt;> ch;
While (ch!="q")
{
Ch=tolower (ch [0]);
If (isalpha (ch [0]))
{
If (ch [0]=='a' | | ch [0]=='e' | | ch [0]=='o' | | ch [0]=='I' | | ch [0]=='u')
+ + vow;
The else
+ + cons;
}
The else
+ + others;
//cin. The get ();
Cin & gt;> ch;
}
Cout & lt; Cout & lt; Cout & lt; return 0;
}

CodePudding user response:

Cin will ignore separator (Spaces break tabs)

CodePudding user response:

reference 1st floor Italink response:
cin will ignore separator (Spaces break tabs)

Is not cin oh, flow operator

CodePudding user response:

reference 1st floor Italink response:
cin will ignore separator (Spaces break tabs)

Soon that ignore a passage to the string, not only is a word in
  • Related