Main.cc: In function ‘int main()’: Main.cc:44:4: error: ‘len’ was not declared in this scope len+=sqrt(pow(a[i],2)-1)*2; ^~~ Main.cc:44:4: note: suggested alternative: ‘lem’ len+=sqrt(pow(a[i],2)-1)*2; ^~~ lem Main.cc:42:10: warning: unused variable ‘lem’ [-Wunused-variable] double lem=0; ^~~