LeetCode刷题笔记- LCP 17.速算机器人 C代码注意点结果 题目 C代码 int calculate(char* s){ int x = 1, y = 0; while (s != NULL && *s != '\0') { if (*s == 'A') { x = 2 * x + y; } else { y = 2 * y + x; } s++; } return x+y; } 注意点 暂无; 结果 题目