Wrong Answer

foo.cc: In function 'int main()':
foo.cc:9:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i = 0; i < s.size(); i++)
      |                 ~~^~~~~~~~~~
foo.cc:11:13: warning: format '%f' expects argument of type 'double', but argument 2 has type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wformat=]
   11 |  printf("%.2f", 100 / s.size() * sum);
      |          ~~~^   ~~~~~~~~~~~~~~~~~~~~
      |             |                  |
      |             double             std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
      |          %.2ld
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer Read 0.00%, expect 27.27%. 2ms 384.0 KiB
#2 Accepted 1ms 384.0 KiB

信息

递交者
类型
递交
题目
P1106 字符出现的频率
语言
C++
递交时间
2022-07-18 21:31:55
评测时间
2022-07-18 21:31:55
评测机
分数
50
总耗时
3ms
峰值内存
384.0 KiB