华为819笔试没通过的话还有下次机会吗
如题,我第一题死活ac0,挠了我两个小时心态爆炸,啥都对着但就是ac0。
后来我好像发现问题了,大家一定要引以为戒啊啊啊啊啊啊
最后大家知道笔试有几次机会啊,我还能挣扎吗
#include <bits/stdc++.h> using namespace std; bool check (int num) { if (num % 10 != 7) return false; num = num / 10; if (num % 2 == 0) return false; return true; } int main() { std::cout << "Hello, World!" << std::endl; int m, n; std::cin >> m >> n; if (m < 10 || n < 10) { cout << "[]"; return 0; } vector<vector<int>> res; int cnt = 0; int up = 0, down = m - up - 1, left = 0, right = n - left - 1; cout << "["; while (cnt < m * n) { for (int y = left; y <= right; y++) { cnt++; if (check(cnt)) { // cout << "[" << up << "," << y << "]";cout << ","; vector<int> tmp; tmp.emplace_back(up); tmp.emplace_back(y); res.emplace_back(tmp); } } if (++up > down) break; for (int x = up; x <= down; x++) { cnt++; if (check(cnt)) { // cout << "[" << x << "," << right << "]";cout << ","; vector<int> tmp; tmp.emplace_back(x); tmp.emplace_back(right); res.emplace_back(tmp); } } if (--right < left) break; for (int y = right; y >= left; y--) { cnt++; if (check(cnt)) { // cout << "[" << down << "," << y << "]";cout << ","; vector<int> tmp; tmp.emplace_back(down); tmp.emplace_back(y); res.emplace_back(tmp); } } if (--down < up) break; for (int x = down; x >= up; x--) { cnt++; if (check(cnt)) { // cout << "[" << x << "," << left << "]";cout << ","; vector<int> tmp; tmp.emplace_back(x); tmp.emplace_back(left); res.emplace_back(tmp); } } if (++left > right) break; } // cout << "]"; cout << "["; for (int i = 0; i < res.size() - 1; i++) { cout << "[" << res[i][0] << "," << res[i][1] << "],"; } cout << "[" << res.back()[0] << "," << res.back()[1] << "]]"; return 0; }大家看到了吗,本地项目自动生成的cout << hello world 我没删!我没删!我没删!我没删!我没删!我没删!我没删!
我没删!我没删!我没删!我没删!我没删!我没删!我没删!我没删!
我好惨啊
#华为##笔试题目#