#include "windows.h"
#include "time.h"
int main(int argc, char* argv[])
{
int a[]={8,8,9,9,10,10,11,11,14,14,15,15,16,16,17,17,19,19,20,20};
int b[]={0,50,0,50,0,50,0,50,0,50,0,50,0,50,0,50,0,50,0,50};
int c,i;
struct tm *local;
time_t t;
t=time(NULL);
local=localtime(&t);
while(1)
{
for(i=0;i<20;i++)
{ if (a[i]==local->tm_hour&&b[i]==local->tm_min)
c=1;
else
c=0;
}
}
}
妳看行嗎 在指定的 時間段 使輸出 C=1 高電平
妳在設計個 接口 接受 C 就行了