1812.判断国际象棋棋盘中一个格子的颜色 十二月 8, 2022 阅读时间:1 分钟 Zwyyy456 Leetcode Data Structure and Algorithms 问题描述 链接到标题 1812.判断国际象棋棋盘中一个格子的颜色 解题思路 链接到标题 太简单了,不写 代码 链接到标题 class Solution { public: bool squareIsWhite(string coordinates) { if ((coordinates[0] - 'a' + 1 - coordinates[1]) % 2 == 0) return false; else return true; } };