题解 | #小乐乐排电梯#
小乐乐排电梯
http://www.nowcoder.com/practice/0f855c7642b74cccb3c2366bb7732d2a
int main() { int n = 0; scanf("%d", &n); int m = 0; if (n < 12) m = 2; else { while (n >= 12) { m += 4; n -= 12; } m += 2; } printf("%d", m); return 0; }
小乐乐排电梯
http://www.nowcoder.com/practice/0f855c7642b74cccb3c2366bb7732d2a
int main() { int n = 0; scanf("%d", &n); int m = 0; if (n < 12) m = 2; else { while (n >= 12) { m += 4; n -= 12; } m += 2; } printf("%d", m); return 0; }
相关推荐