Problem card
User YH
Submission Time 2024-02-06 16:15:35
Score 0
Max Time N/A
Max Memory N/A

Compile Error

card.cpp: In function ‘int main()’:
card.cpp:29:3: error: expected ‘}’ before ‘else’
29 | else if (x == m-1) {
| ^~~~
card.cpp:26:15: note: to match this ‘{’
26 | if (x == 0) {
| ^
card.cpp:31:15: error: cannot convert ‘Node’ to ‘Node*’ in assignment
31 | end.head = *temp_node;
| ^~~~~~~~~~
| |
| Node
card.cpp:33:19: error: ambiguous overload for ‘operator=’ (operand types are ‘Node’ and ‘Node*’)
33 | ending_node = &end;
| ^~~
card.cpp:5:7: note: candidate: ‘constexpr Node& Node::operator=(const Node&)’ <near match>
5 | class Node {
| ^~~~
card.cpp:5:7: note: conversion of argument 1 would be ill-formed:
card.cpp:33:18: error: invalid user-defined conversion from ‘Node*’ to ‘const Node&’ [-fpermissive]
33 | ending_node = &end;
| ^~~~
car