Problem lengthsort
User Henries
Submission Time 2024-10-02 12:05:59
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In function ‘int main()’:
lengthsort.cpp:14:7: error: conflicting declaration ‘auto count’
14 | map[count] = s;
| ^~~~~
lengthsort.cpp:10:13: note: previous declaration as ‘long long int count’
10 | long long count =0;
| ^~~~~
lengthsort.cpp:16:21: error: conversion from ‘std::pair<const long long int, std::__cxx11::basic_string<char> >’ to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
16 | for (string item : m){
| ^
lengthsort.cpp:17:16: error: ‘std::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘second’
17 | cout << item.second;
| ^~~~~~