Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use c # to realize the problem of fishing and drying the net

Shulou Source: shulou.com Published: 2022-06-01 11:23:15 10月03日 Update

This article mainly introduces "how to use c # to realize the problem of fishing and drying the net". In the daily operation, I believe that many people have doubts about how to use c # to realize the problem of fishing and drying the net. The editor consulted all kinds of materials and sorted out a simple and useful method of operation. I hope it will be helpful for everyone to answer the question of "how to use c # to realize the problem of fishing and drying the net." Next, please follow the editor to study!

If a fisherman starts fishing every three days and drying the net every two days since January 1, 2011, it is programmed to output whether the fisherman is fishing or drying the net on any day after January 1, 2011.

C code:

/ * on the sixth day, the problem of fishing and basking in the net * / # include # include int leap (int a) {if ((a% 4 = = 0) & & (a% 100! = 0) | | (a% 400 = = 0) return 1 posielsereturn 0;} int number (int year,int month,int day) {int result = 0PersoniJing KMIT average_year [12] = {31pc28, 31pr, 31pr, 31pr, 31pr, 31pr, 31pr, 31pr, 31pr, 31g, 330j, 330g, 31g, 330g, 330g / / Leap year if (leap (year) = = 1) {for (I = 0 position I)

< month - 1;i++) result += leap_year[i]; result += day; }else{for(i = 0;i < month - 1;i++) result += average_year[i]; result += day; }for(j = 2011;j < year;j++)if(leap(year) == 1) result += 366;elseresult += 365;return result;}void main(void){int year,month,day,days;printf("请输入要查询的年月日,例如2011-10-10\n"); scanf("%d-%d-%d",&year,&month,&day); days = number(year,month,day);if((days % 5) < 4 && (days % 5) >

0) printf ("% d year% d month% d day: fisherman fishing\ n", year,month,day); elseprintf ("% d year% d month% d day: fisherman drying net\ n", year,month,day); system ("pause");}

The results show that:

At this point, the study on "how to use c # to realize the problem of fishing and drying the net" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Questions fishermen learning more help input practicality next code usual year year month day article method is in theory knowledge article result Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Shulou Technology Xiaomi Docker