F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_38820019_32662.cpp: In function 'int get(std::string)':
0_0_38820019_32662.cpp:12:13: error: declaration of 'auto& amp' has no initializer
   12 |         for(auto &c: s) x += (c - '0');
      |             ^~~~
0_0_38820019_32662.cpp:12:24: error: found ':' in nested-name-specifier, expected '::'
   12 |         for(auto &c: s) x += (c - '0');
      |                        ^
      |                        ::
0_0_38820019_32662.cpp:12:23: error: 'c' has not been declared
   12 |         for(auto &c: s) x += (c - '0');
      |                       ^
0_0_38820019_32662.cpp:13:11: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(std::__cxx11::to_string(int)())' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |         s = to_string(x);
      |         ~~^~~~~~~~~~~~~~
      |           |
      |           std::__cxx11::basic_string<char>
0_0_38820019_32662.cpp:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
0_0_38820019_32662.cpp:13:26: error: expected ')' before '}' token
   13 |         s = to_string(x);
      |                          ^
      |                          )
   14 |     }
      |     ~                     
0_0_38820019_32662.cpp:12:12: note: to match this '('
   12 |         for(auto &c: s) x += (c - '0');
      |            ^
0_0_38820019_32662.cpp:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-05 10:18:30, Gzip enabled