Câu hỏi của Phạm Văn dũng

Bài tập về sắp xếp chuỗi theo thứ tự abc

Pasted image 1920x1080 170 KB char *ptr[5]; char str1[5][10]; int i,j; for(i=0;i<5;i++) { printf("nhap chuoi thu %d vao : ",i+1); scanf("%s",str1[i]); ptr[i]=str1[i]; } char str2[5][10]; for(i=0;i<5;i++) strcpy(str2[i],str1[i]); char *temp; for(i=0;i<4;i++) { for(j= ...

Phạm Văn dũng viết 09:26 ngày 01/10/2018 chỉnh sửa

Bài tập đếm nguyên âm

chr word[10]; int *ptr,dem=0,i; printf(" nhap chu : "); scanf("%s",word); ptr=&word[0]; for(i=0 ;i < strlen(word);i++) { if ((*ptr='u') || (*ptr='e') || (*ptr='o') || (*ptr='a') || (*ptr='i') ) dem++; ptr++; } printf("chuoi co %d ki tu la nguyen am",dem); em debug thì ...

Phạm Văn dũng viết 09:26 ngày 01/10/2018 chỉnh sửa
1