/ Vijos /

记录详情

Compile Error

foo.cpp:4:7: error: reference to 'max' is ambiguous
 int f[max];
       ^
foo.cpp:3:11: note: candidates are: const int max
 const int max= 1010;
           ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:261:5: note:                 template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:217:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
foo.cpp: In function 'int main()':
foo.cpp:8:19: error: 'scanf' was not declared in this scope
     scanf("%d", &n);
                   ^
foo.cpp:9:5: error: 'f' was not declared in this scope
     f[1] = 1;
     ^
foo.cpp:15:22: error: 'printf' was not declared in this scope
     printf("%d", f[n]);
                      ^

信息

递交者
类型
递交
题目
P1130 数的计数
语言
C++
递交时间
2015-10-12 17:18:35
评测时间
2015-10-12 17:18:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes