题解 | 明天星期几?

明天星期几?

https://www.nowcoder.com/practice/9db9e3d19cde405ba94db09ed1c5f3f3

#include <stdio.h>

int main(void)
{
	int input = 0;
	scanf("%d", &input);
	if (input >= 1 && input <= 7)
	{
		if (input == 7)
		{
			printf("1");
		}
		else
		{
			printf("%d", input + 1);
		}
	}
	else
	{
		printf("输入数字非法");
	}
	return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务