题解 | #小乐乐排电梯#
小乐乐排电梯
https://www.nowcoder.com/practice/0f855c7642b74cccb3c2366bb7732d2a
#include <stdio.h>
void better_pig(int x)
{
if ((x % 12) == 0)
printf("%d", (4 * (x / 12) + 2));
else
printf("%d", (4 * (x / 12)+2 ));
}
int main() {
int a = 0;
scanf("%d", &a);
better_pig(a);
return 0;
}

查看10道真题和解析