Пример #1
0
static void
putKcp(
    char	*start,		/* start of string to write */
    char	*end,		/* end of string to write */
    bool	force)		/* true if we should force nokeyw */
{
    int i;
    int xfld = 0;

    while (start <= end) {
	if (idx) {
	    if (*start == ' ' || *start == '\t') {
		if (xfld == 0)
		    printf("");
		printf("\t");
		xfld = 1;
		while (*start == ' ' || *start == '\t')
		    start++;
		continue;
	    }
	}

	/* take care of nice tab stops */
	if (*start == '\t') {
	    while (*start == '\t')
		start++;
	    i = tabs(x_start, start) - margin / 8;
	    printf("\\h'|%dn'", i * 10 + 1 - margin % 8);
	    continue;
	}

	if (!nokeyw && !force)
	    if ((*start == '#' || isidchr(*start))
	    && (start == x_start || !isidchr(start[-1]))) {
		i = iskw(start);
		if (i > 0) {
		    ps("\\*(+K");
		    do
			putcp(*start++);
		    while (--i > 0);
		    ps("\\*(-K");
		    continue;
		}
	    }

	putcp(*start++);
    }
}
Пример #2
0
/*
 * start: start of string to write
 * end: end of string to write
 * force: true if we should force nokeyw
 */
static void
putKcp(char *start, char *end, bool force)
{
    int i;
    int xfld = 0;

    while (start <= end) {
	if (idx) {
	    if (*start == ' ' || *start == '\t') {
		if (xfld == 0)
		    printf("\001");
		printf("\t");
		xfld = 1;
		while (*start == ' ' || *start == '\t')
		    start++;
		continue;
	    }
	}

	/* take care of nice tab stops */
	if (*start == '\t') {
	    while (*start == '\t')
		start++;
	    i = tabs(s_start, start) - margin / 8;
	    printf("\\h'|%dn'", i * 10 + 1 - margin % 8);
	    continue;
	}

	if (!nokeyw && !force)
	    if ((*start == '#' || isidchr(*start))
	    && (start == s_start || !isidchr(start[-1]))) {
		i = iskw(start);
		if (i > 0) {
		    ps("\\*(+K");
		    do
			putcp((unsigned char)*start++);
		    while (--i > 0);
		    ps("\\*(-K");
		    continue;
		}
	    }

	putcp((unsigned char)*start++);
    }
}
Пример #3
0
int main() {
	int i=1;  // 배열의 인덱스
	int yyyy = 1970;
	int mm = 1;  //1~12
	int lastDate;
	int dd = 1;  //1~28,29,30,31 
	int hh = 0;  //00~24
	int MM = 0;  //00~59
	int ss = 0;  //00~59
	int kw[11111];

	lastDate = getLastDate(yyyy, mm);
	for(int j=0; j<10000; j++) {
		//iskw == true면 
		//	yyyy-mm-dd hh:MM:ss형식으로 바꾸기
		//	결과 배열에 넣기

		//시간계산
		ss++;
		if(ss % 60 == 0) {
			MM++;
		}
		if(MM % 60 == 0 && MM != 0) {
			hh++;
		}
		if(hh%24 == 0 && hh != 0) {
			dd++;
		}
		if(dd == lastDate+1) {
			dd = 1;
			mm++;
			lastDate = getLastDate(yyyy, mm);
		}
		if(mm%13 == 0) {
			yyyy++;
		}

		int res = yyyy*10000000000 + (mm%13)*100000000 + dd*1000000 + (hh%24)*10000 + (MM%60)*100 + ss%60;

		
		char date[14]={res};
		printf("%s\n", date);

		if(iskw(date)) {
			//성시
			int res = yyyy*10000000000 + (mm%13)*100000000 + dd*1000000 + (hh%24)*10000 + (MM%60)*100 + ss%60;
			kw[i] = res;
			i++;
		}
		printf("%s\n", date);
	}

	int testCase;
	scanf("%d", &testCase);
	for(int k=0; k<testCase; k++) {
		printf("#testCase%d\n", k+1);
		int input;
		scanf("%d", &input);
		printf("%d", kw[input]);
	}
}