1. Day of the Week
"The results are in the blanks" (5 points)
The National Day of 1949 (October 1) is Saturday.
The National Day of the Year (2012) is Monday.
So, from the founding of the present, how many times the National day is just Sunday?
As long as the answer, unlimited means!
You can use Windows Calendar, Windows Calculator, Excel formulas, .....
Of course, you can also program!
Do not ask to write exactly what year, as long as a number!
Never submit the source code!
The answer should not be written here, in the "answer. txt"
Answer: 9
S. Mainly the use of surplus
#include <iostream>#include<stdio.h>using namespacestd;intFinti) { if(((i%4==0) && (i% -!=0)) || (i% -==0) )return 366; return 365;}intMain () {intsum=0;//is the number of days in Sunday intD=6;//Day of the week inti; for(i=1950; i<= -; i++) {D= (f (i)%7+D)%7; if(d==0) sum++; } printf ("%d\n", sum); return 0;}
View Code
PS: It's easier to use Excel
2012 The third Blue Bridge Cup C + + program design Undergraduate B group finals