
有没有好心的大神帮我看看我的代码哪里有问题QAQ我的问题是数组没输入完整程序就莫名开始跑了输入3 31 2 3然后我想输第二行数组时结果直接输出0---用的code::blocks gcc 14.2.0#include bits/stdc.husing namespace std;mapint, int mp;int main(){ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);int n, m;cin n m;// 读入 n*m 个数字for(int i 1; i n * m; i){int x;cin x;mp[x];}// 遍历 map 找结果for(const auto [x, y] : mp){if(2 * y n * m){cout x \n;}} // --- 这里补上了 for 循环的大括号return 0; // --- return 0 应该在这里不属于任何循环}