Current location - Loan Platform Complete Network - Big data management - (1) Input a piece of English from the keyboard and program the number of occurrences of the letters "a" and "E" in it.
(1) Input a piece of English from the keyboard and program the number of occurrences of the letters "a" and "E" in it.
(1) The program is as follows:

#include <stdio.h>

void main()

{

int i=0,j=0;

char c;

printf("Please enter:\n");

while((c=getchar())! while((c=getchar())! ='\n')

{

if(c=='a')i++;

if(c=='E')j++;

}

printf("a: %d of E: %d of \n",i,j);

}

(2) Program as follows:

# include <stdio.h>

#include <string.h>

void main()

{

char a[30]="asdjttheklthewn",b[10]="the";

< p>printf("str first address:%x,first occurrence of string the:%x\n",a,strstr(a,b));

}