程序没有报错,但是运行就直接结束了

img


第一次遇到这种情况,也没有报错,但是运行啥也没有,然后那个mp.size函数哪里还有警告comparison of integer expressions of different signedness: 'std::map<char, int>::size_type' {aka 'long long unsigned int'} and 'int' [-Wsign-compare]|,nl nr定义的变量也有个警告variable 'nl' set but not used [-Wunused-but-set-variable

数组a定义为全局的,不然可能会内存溢出

换下编辑器试试,有时间是编辑器有问题

换个IDE编辑器吧
简单便捷:
Devc++


效果呈现好:
Viisual Studio

希望对题主有所帮助!可以的话,帮忙点个采纳!