当前位置:网站首页>L1-024 the day after tomorrow (5 points)

L1-024 the day after tomorrow (5 points)

2022-07-04 07:29:00 Inter personal liabilities^

L1-024 The day after tomorrow (5 branch )

If today is Wednesday , The day after tomorrow is Friday ; If today is Saturday , The day after tomorrow is Monday . We use Numbers 1 To 7 Monday to Sunday . Given a day , Please export that day “ The day after tomorrow ” What day is .

Input format :
The first line of input gives a positive integer D(1 ≤ D ≤ 7), Represents a day of the week .

Output format :
Output in one line D What day is the day after tomorrow .

sample input :

3

sample output :

5

AC Code

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<sstream>

using namespace std;
typedef long long ll;
const int N=100010;

int main()
{
    
	int n;
	cin >> n;
	n += 2;
	if(n != 7) n %= 7;
	cout << n << endl; 
	return 0;
}



原网站

版权声明
本文为[Inter personal liabilities^]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141533229379.html