This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main() | |
| { | |
| int year,month,day,day1,day2,sum=0,test; | |
| scanf("%d",&test); | |
| while(test!=0) | |
| { | |
| test--; | |
| scanf("%d/%d/%d",&year,&month,&day); | |
| if(year<1970||month>12||day>31||(month==2&&((day==30)||(day==31)))||(month==4&&day==31)||(month==6&&day==31)||(month==9&&day==31)||(month==11&&day==31)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int is_leap(int year) /*~自訂函式~判斷閏年函式*/ | |
| { | |
| return (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)); | |
| } | |
| int hm_days(int year,int mon) /*~自訂函式~一個月有幾天?...函式*/ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int is_leap(int year) /*~自訂函式~判斷閏年函式*/ | |
| { | |
| return (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)); | |
| } | |
| int hm_days(int year,int mon) /*~自訂函式~一個月有幾天?...函式*/ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(void) | |
| { | |
| int hmday[13]={0,31,28,31,30,31,30,31,31,30,31,30}; | |
| int year,mon,dat; | |
| while(scanf("%d/%d/%d",&year, &mon, &dat)>2) | |
| { | |
| hmday[2] = (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) ? 29:28; | |
| printf((year < 1970 || mon > 12 || mon < 1 || dat > hmday[mon] || dat < 1) ? "Wrong\n":"Yes!!\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define MAX 1000001 | |
| int search[MAX]={0}; | |
| void swap(int*,int*); | |
| int n(int, int); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define MAX 46342 | |
| int bitmap[MAX]={0}; | |
| int prime_list[5000]={0}; | |
| void mk_prime(void); | |
| int is_prime(int); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define MAX 46342 | |
| int bitmap[MAX]={0}; | |
| int prime_list[5000]={0}; | |
| void mk_prime(void); | |
| int is_prime(int); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(void) | |
| { | |
| int i; | |
| int sum = 0; | |
| for(i=2;i<=10;i+=2) | |
| sum+=i; | |
| printf("%d",sum); | |
| return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(void) | |
| { | |
| int i, j; | |
| for(i=1;i<=9;i++) | |
| { | |
| for(j=1;j<=9;j++) | |
| //////////////請自行腦補XD/////////////// | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main() | |
| { | |
| int input , num1 , num2 , s1[1000] , s2[1000] , s3[2000] , i , flag=0 , m , n , k=0 , l; | |
| scanf("%d",&input); | |
| for(i=0;i<input;i++) | |
| { | |
| scanf("%d%d",&num1,&num2); |
OlderNewer