/ Vijos / 讨论 / Vijos /

Vijos不支持C++11

#include <cstdio>

int main ()
{
int a, b;
scanf ("%d%d", &a, &b);
auto plus = ->int {return x + y;};
printf ("%d\n", plus (a, b));
return 0;
}

编译失败(CompileError)

foo.cpp: In function 'int main()':
foo.cpp:7:5: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
auto plus = ->int {return x + y;};
^
foo.cpp:7:10: error: 'plus' does not name a type
auto plus = ->int {return x + y;};
^
foo.cpp:8:31: error: 'plus' was not declared in this scope
printf ("%d\n", plus (a, b));
^
CompileError, time = 0 ms, mem = 0 KiB, score = 0

这跟帮助里说的不一样啊⊙﹏⊙

2 条评论

  • @ 2016-08-08 01:56:36

    您好,现在已将C++11的编译开关加入评测机编译命令中。希望您在Vijos刷题愉快 (^v^)

  • @ 2016-08-06 11:00:18

    因为爱情。

  • 1