Group Programming Ladder l1-024 the day after tomorrow

Source: Internet
Author: User
Tags time limit

l1-024. Acquired time limit
Memory Limit 65536 KB
Code length limit 8000 B
Chen, standard author of the procedure for the award of questions

If today is Wednesday, the day after Tomorrow is Friday, if today is Saturday, the day after Tomorrow is Monday. We correspond Monday to Sunday with numbers 1 to 7. Given the day, please output the day after tomorrow is the days of the week.

Input Format:

Enter the first line to give a positive integer d (1 <= D <=7), representing the day of the week.

output Format:

The day of the week after which the day of D is exported in a row. Input Sample:

3
Sample output:
5

————————————————————————————————————

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
using namespace std;
#define INF 0x3f3f3f3f



int main ()
{
int n;
scanf ("%d", &n);
n+=2;
if (n>7)
    n-=7;
printf ("%d\n", n);

    return 0;
}





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.