foo.cpp: In function 'int main()':
foo.cpp:13:9: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
for(auto x : v) ans += x;
^
foo.cpp:13:14: error: 'x' does not name a type
for(auto x : v) ans += x;
^
foo.cpp:14:5: error: expected ';' before 'cout'
cout << ans << endl;
^
foo.cpp:15:1: error: expected primary-expression before '}' token
}
^
foo.cpp:15:1: error: expected ')' before '}' token
foo.cpp:15:1: error: expected primary-expression before '}' token
foo.cpp:15:1: error: expected ';' before '}' token