0_0_17889021_13527.cpp: In function 'int main()': 0_0_17889021_13527.cpp:17:13: error: expected ';' before 'if' if(a[i]>=0&&sum>=0) num++; ^ 0_0_17889021_13527.cpp:18:13: error: 'else' without a previous 'if' else if(a[i]>=0&&sum<0) sum+=a[i]; ^