C Calculate how many days of the 21st century it is?

Updated on culture 2024-05-19
13 answers
  1. Anonymous users2024-02-10

    I specified the end date in the program, and if necessary, you can read it in with the command line, very easy

  2. Anonymous users2024-02-09

    #include

    using namespace std;

    int main()

    int a=;The cumulative number of days in the month.

    int year, month, day;

    cin>>year>>month>>day;

    *Calculation of the number of days in the current year***

    int days = a[month-1] +day;The number of days in the current year.

    if((month> whether the current year is a Swiss year.

    days++;

    *The year of the middle difference is actually calculated ***

    int temp = year - 2000;The year in the middle of the difference.

    days += 365 * temp;

    for(int i=2000; icoutreturn 0;

  3. Anonymous users2024-02-08

    case 1: case 2:……It should be in this form, month is an integer not a character, and there is no need to add ''

  4. Anonymous users2024-02-07

    It's not simple, make a two-dimensional array a[2][12] to store months, a[0] to store common years, and a[0] to store leap years! Just add it up with the for loop!

  5. Anonymous users2024-02-06

    #include

    using namespace std;

    const int a[13]=;

    int n,y,t,sum;

    int main()

    sum+=t;

    if ((n%4==0) &n%100!=0)) n%400==0))

    sum+=1;

    printf("This day is the %d day of the year. ",sum);

    system("pause");

    return 0;

    Notepad written, no input time error maintenance, hope it helps - Mianzhong oi13 level.

  6. Anonymous users2024-02-05

    You can use datetime to get the complex.

    That is, the current date system is the first day of the year, for example, 2012-02-20 now shows the 51st day of 2012.

    If there's a character, that's it.

    string str = "2012/02/20 12:00:00";

    It's the same way.

  7. Anonymous users2024-02-04

    Leave a space after the keyword case Ha:

    #include

    using namespace std;

    void main()

    cout <<"For the first of the year" <

  8. Anonymous users2024-02-03

    You're not wrong with me, there's nothing wrong with this, I've run it.

    Operating environment GCC

    #include

    using namespace std;

    main()

    In the case of leap years, then March and later months are calculated with +1 (28 days in February and 29 days in leap years).

    cout<

  9. Anonymous users2024-02-02

    #include

    #include

    int main()

    if (look)

    day1 += day + 1;

    elseday1 += day;

    printf("%d year, %d month, %d day is the %d day of the year", year, month, day, day1);

    system("pause");

    return 0;}

  10. Anonymous users2024-02-01

    if(The problem is here.)

    In C++, the comparison operator should be "==" instead of "=".

    It is recommended to write if(1== next time, so that if something goes wrong, the compiler will report an error.

    Hope it helps!!

  11. Anonymous users2024-01-31

    #include

    using namespace std;

    int main()

    int a[12]=;

    int year,month,day;

    int sum=0;

    cout<<"Please enter the year, month and day">year>>month>>day;

    if(month==1)

    sum=day;

    else if(month<=2)

    sum=31+day;

    elseif(year%100==0)

    if(year%4==0)

    for(int i=0;isum=sum+a[i];

    sum=sum+1+day;

    elsefor(int k=0;ksum=sum+a[k];

    sum=sum+day;

    elseif(year%4==0)

    for(int i=0;isum=sum+a[i];

    sum=sum+1+day;

    elsefor(int k=0;ksum=sum+a[k];

    sum=sum+day;

    cout<<>

    The watchtower owner.

  12. Anonymous users2024-01-30

    #include

    void main()

    cout<<"Please enter your year, month, and day:"cin>>year>>month>>day;

    for(int i=0;i2)

    cout<<"This day is the first day of the year"

  13. Anonymous users2024-01-29

    for (i=0;i The day above has been added many times.

Related questions
4 answers2024-05-19

Do you know? When astronauts in space look back at our Earth, they find that Earth is a beautiful blue "water ball" in the vast universe. >>>More

3 answers2024-05-19

The analysis of China's great achievements in the 21st century is as follows: >>>More

5 answers2024-05-19

Diversified development, the combination and decomposition of multiple dance genres.

4 answers2024-05-19

Earlier, when it came to participating in weddings in Shanghai, the biggest impression was that the process of toasting and lighting cigarettes was the most difficult. >>>More

9 answers2024-05-19

Although in 1995 in China's computer and Internet, but because Ma Yun went abroad, especially the United States and other Western countries computers and networks have been very popular, so it is not difficult to make such a **, the key is to seize this opportunity to appear to be a master. I remember there was a TV set that filmed their business start-up, and it was really hard at the time, but it worked out.