记录详情

Compile Error

foo.cc: In function 'void Output(std::vector<std::vector<int> >&)':
foo.cc:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i=0; i<M.size(); i++)
      |               ~^~~~~~~~~
foo.cc:21:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |   for(int j=0; j<M[i].size(); j++){
      |                ~^~~~~~~~~~~~
foo.cc:24:10: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   24 |   printf('\n');
      |          ^~~~
      |          |
      |          char
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6493,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:32: note:   initializing argument 1 of 'int printf(const char*, ...)'
  105 | printf (const char *__restrict __fmt, ...)
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
foo.cc:24:14: warning: format not a string literal and no format arguments [-Wformat-security]
   24 |   printf('\n');
      |              ^
foo.cc: In function 'void SortRow(std::vector<std::vector<int> >&)':
foo.cc:30:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for(int k=0; k<M.size(); k++)
      |               ~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
6-5 矩阵的行排序
语言
C++
递交时间
2021-12-14 11:26:15
评测时间
2021-12-14 11:26:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes