输入十个字符,再删除其中与我输入那个字符相同的的字符,不知道为什么我写的这个一直就是删除最后一个字符,求大神看下
#include <stdio.h> int main( void ) { int n, j; char i[10]; char c; for ( n = 0; n < 10; n++ ) scanf( "%c", &i[n] ); scanf( "%c", &c ); for ( n = 0; n < 10; n++ ) { if ( i[n] == c ) { i[n] = i[n + 1]; for ( j = n + 1; j < 10; j++ ) { i[j] = i[j + 1]; } } } for ( n = 0; n < 9; n++ ) printf( "%c", i[n] ); return(0); }