int main() { int rv = 0; TEMPO(7, 250*TIMEBASE, rv, rv); // 61 rv += func_a(1); TEMPO(12, 150*TIMEBASE, rv, rv); // 63 rv += func_b(0); TEMPO(9, 150*TIMEBASE, rv, rv); // 65 return rv; }
int main(int argc, char *argv[]){ int sum; func_a("prog_main calls func_a"); sum = func_b(10,20); printf("The sum of 10 and 20 is %d.\n",sum); return 0; }
void func_call() { func_a ( 1, 2, 3); func_b ( 4, 5, 6 ); func_c ( 7, 8, 9 ); func_d ( "aaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbb", "cccccccccccccccccccccc" ); }
main(int argc, char *argv[]) { int i; (void)atexit(bye); for (i=1; i<10; i++) { func_a(i); } for (i=1; i<30; i++) { (void) func_b(i); } }
/** * This function calculates the inverse of the entropy for a given set of examples on a special attribute. * This may be used to find the most important attribute of a set. */ double gain(obj** examples, int num_examples, int attrib_num) { if (!num_examples) return 0; int pos, pospos, ipos, ipospos; /* Calculate number of examples where attrib is 1 and 2 (i and not i) and where class is 1 * See num_pos function comment for more expl. */ num_pos(examples, num_examples, attrib_num, &pos, &pospos, &ipos, &ipospos); /* Sum all weighted entropies */ double inv_gain = 0.0f; if (pos) inv_gain = ((double) pos / num_examples) * func_b((float) pospos / pos); if (ipos) inv_gain += ((double) ipos / num_examples) * func_b((double) ipospos / ipos); /* And return the inverse */ return 1 - inv_gain; }
int main() { /* Install our signal handler */ struct sigaction sa; sa.sa_sigaction = (void *)bt_sighandler; sigemptyset (&sa.sa_mask); sa.sa_flags = SA_RESTART | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGUSR1, &sa, NULL); /* ... add any other signal here */ /* Do something */ printf("%d#92;n", func_b()); }
int main(int argc, char** argv) { // install our signal handler struct sigaction sa; sa.sa_sigaction = bt_sighandler; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART|SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGUSR1, &sa, NULL); // ... add any other signal here // do something printf("%d\n", func_b()); return 0; }
int main (int arg, char *argv[]) { func_a(); func_b(); return 0; }
void sxc_debug(FILE *fp) //调试主监听程序 { char input[100],var[100]; char cmd; int para = 0; int i = 0; de_flag = 0; para = 0; while (1) { gets(input); if (strcmp(input, "\0") != 0) break; } cmd = input[0]; switch (cmd) { case 'h': runcode = 0; show_help(); break; case 'b': runcode = 0; if (input[1] != ' ') show_help(); else { i = 2; while (input[i] != '\n' && input[i++] != '\0') { if (input[i - 1] >= 48 && input[i - 1] <= 57) { para = para*10+(input[i - 1] - '0'); } else { show_help(); break; } } if (de_flag == 0) { func_b(para,0); } } break; case 'n': runcode = 1; if (input[1] != '\0') show_help(); else func_n(fp); break; case 'r': runcode = 1; if (input[1] != '\0') show_help(); else sxc(fp); break; case 'p': runcode = 0; if (input[1] != ' ' && input[1] != '\n' && input[1] != '\0') show_help(); else if (input[1] == '\0') func_p("-a"); else func_p(input + 2); break; case 'l': runcode = 0; if (input[1] != ' ' && input[1] != '\n' && input[1] != '\0') show_help(); else if (input[1] == '\0') func_l(fp, -1); else { i = 2; while (input[i] != '\n' && input[i++] != '\0') { if (input[i - 1] >= 48 && input[i - 1] <= 57) { para = para * 10 + (input[i - 1] - '0'); } else { show_help(); break; } } if (de_flag == 0) { func_l(fp, para); } } break; case 'd': runcode = 0; if (input[1] != ' ') show_help(); else { i = 2; while (input[i] != '\n' && input[i++] != '\0') { if (input[i - 1] >= 48 && input[i - 1] <= 57) { para = para * 10 + (input[i - 1] - '0'); } else { show_help(); break; } } if (de_flag == 0) { func_d(para,0); } } break; case 's': runcode = 0; if (input[1] != '\0') show_help(); else func_s(); break; case 'k':if (input[1] != '\0') show_help(); else func_k(); break; case 'q':if (input[1] != '\0') show_help(); else func_q(fp); break; default:show_help(); break; } }
void func_a() { func_b(); }