摘要:
#include #define MAXLINE 1000int getline(char line[], int max);int strindex(char source[], char searchfor[]);char pattern[] = "ould";main(){ char line[MAXLINE]; int found = 0; while (getline(line, MAXLINE) > 0) if (strindex(line, pattern) >= 0) { printf("%s", line);... 阅读全文
摘要:
static char daytab[2][13] = { {0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31}};/* 将某日某月的日期表示形式转换为某年中第几天的表示形式*/int day_of_year(int year, int month, int day){ int i, leap; leap = year%4 == 0 && year%100 != 0 || year%400 == 0; for (i = 1; i daytab[leap][... 阅读全文