Problem add1
User Yinnotayl64
Submission Time 2026-11-05 10:34:55
Score 0
Max Time N/A
Max Memory N/A

Compile Error

add1.cpp: In function ‘int main()’:
add1.cpp:10:46: error: conversion from ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’} to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
10 | string lastDigit = to_string(lastdigit).back();
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~
add1.cpp:12:14: error: cannot convert ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘char’
12 | n.push_back(lastDigit);
| ^~~~~~~~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included 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/istream:38,
from /usr/incl