#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int main(){
char s[255],k;
int a,j,l;
printf("masukkan string = ");
gets(s);//masukkan string
l=0;//inisialisasi
for (a=1;a<(strlen(s));a++){
j=a;
k=s[a];
while(s[j-1]>k && j>0){s[j]=s[j-1];j=j-1;}
s[j]=k;
}
for(a=0;a<(strlen(s));a++){
printf("%c",s[a]);
}
for(a=0;a<(strlen(s));a++){
if((s[a]=='i') ||( s[a]=='I')){
l=l+1;
}
}
printf("\n");
printf("jumlah huruf I atau i = %d",l);
getch();
return 1;
}
0 comments:
Posting Komentar