Accepted

foo.cc: In function 'int myAtoi(std::string)':
foo.cc:10:6: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  if(i==s.length()||(s[i]>'9'||s[i]<'0')&&s[i]!='+'&&s[i]!='-'){
      |     ~^~~~~~~~~~~~
foo.cc:10:51: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   10 |  if(i==s.length()||(s[i]>'9'||s[i]<'0')&&s[i]!='+'&&s[i]!='-'){
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
foo.cc:20:11: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for(i=i;i<s.length();i++){
      |          ~^~~~~~~~~~~
foo.cc:6:29: warning: unused variable 'a' [-Wunused-variable]
    6 |  long long sum=0,i=0,flag=1,a=-2147483648;
      |                             ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 3ms 512.0 KiB
#2 Accepted 2ms 384.0 KiB
#3 Accepted 1ms 384.0 KiB
#4 Accepted 2ms 384.0 KiB

信息

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