Wrong Answer

foo.cc: In function 'int myAtoi(std::string)':
foo.cc:24:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |  while(i<s.size())
      |        ~^~~~~~~~~
foo.cc:6:17: warning: unused variable 'len' [-Wunused-variable]
    6 |  int i=0,flag=1,len=1;
      |                 ^~~
foo.cc: In function 'int main()':
foo.cc:54:6: warning: unused variable 'n' [-Wunused-variable]
   54 |  int n=s.length();
      |      ^
foo.cc: In function 'int myAtoi(std::string)':
foo.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 4ms 512.0 KiB
#2 Accepted 4ms 384.0 KiB
#3 Wrong Answer Read -497138036, expect 2147483647. 2ms 384.0 KiB
#4 Wrong Answer Read 780277778, expect -2147483648. 1ms 384.0 KiB

信息

递交者
类型
递交
题目
P1109 字符串转换为整数
语言
C++
递交时间
2022-07-18 19:51:07
评测时间
2022-07-18 19:51:07
评测机
分数
50
总耗时
13ms
峰值内存
512.0 KiB