这个是我的代码,但是有问题,能不能帮忙改一改
#include<stdio.h>
int common_elements(int length, int source1[length], int source2[length], int destination[length]) {
int i = 0;
int e = 0;
while (i < length) {
int a_i = 0;
while (a_i < length) {
if (source1[i] == source2[a_i] && source2[a_i] != destination[e] && source1[i] != destination[e]) {
destination[e] = source1[i];
e++;
a_i++;
}
a_i++;
}
i++;
}
return e;
}
int main(void){
return 0;
}
图片绿色的那行是正确的形式,红色的是我写的错误的形式。
图片显示的那一行应该是有问题的,但我不知道怎么改。