String, array
/*
==================================================================
Topic:
Enter a line of characters, output the consonants in reverse order (remove the vowel letters), and store them in another string!
==================================================================
*/
#include <stdio.h>
#include <string.h>
#define N 256
void Main ()
{
Char A[n],b[n];
int i,j,k=0;
printf ("Input string: \ n");
Gets (a);
For (I=0;i<strlen (a); i++)
if (a[i]!= ' a ' &&a[i]!= ' o ' &&a[i]!= ' e ' &&a[i]!= ' i ' &&a[i]!= ' u ' &&
a[i]!= ' A ' &&a[i]!= ' O ' &&a[i]!= ' E ' &&a[i]!= ' i ' &&a[i]!= ' U ')
B[k++]=a[i];
printf ("Reverse output consonant: \ n");
for (j=k-1;j>=0;j--)
printf ("%c", B[j]);
printf ("\ n");
}
/*
===================================================================
Evaluation:
First, knowing the vowel letters, when a[i]! = When the vowel letter is assigned to b[k++], the length of natural B is k; then from K-1
to 0 output string B, the reverse output is completed, in fact, the key point is to assign value!
===================================================================
*/
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Basic algorithm of C language 40-string Delete vowel letter Reverse Output