發新話題

[問題] C語言 還有其他方式 做出 刪除重複?

C語言 還有其他方式 做出 刪除重複?

#include<stdio.h>
#include<stdlib.h>
#include <string.h>
main()
{
char A[100];
int i=0,j;
printf("input:");
gets(A);
while(i<strlen(A))
{
j=i+1;
while(j<strlen(A))
{
if(A[j]==A)
{
A[j]='\0';
strcat(A,A+j+1);
}
else
j++;
}
i++;
}
puts(A);
system("pause");
}

雖然跑出來是對的 有沒有其他方式做出來???

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。