1. 進一步掌握和利用C語言進行程序設計的能力; 2. 進一步理解和運用結構化程序設計的思想和方法; 3. 初步掌握開發一個小型實用系統的基本方法; 4. 學會調試一個較長程序的基本方法; 5. 學會利用流程圖或N-S圖表示算法; 6. 掌握書寫程設計開發文檔的能力 (書寫課程設計報告) 。
上傳時間: 2013-12-21
上傳用戶:qq1604324866
最速下降法是以負梯度方向作為下降方向的極小化算法,本程序用該方法求解n元正定二次函數的極小值
上傳時間: 2013-12-03
上傳用戶:Thuan
int main(int argc,char *argv[]) { char ch while(true) { printf("*************************************\n") printf(" 1.Reader Priority\n") printf(" 2.Writer Priority\n") printf(" 3.Exit to Windows\n") printf("*************************************\n") printf("Enter your choice(1,2,3): ") do{ ch=(char)_getch() }while(ch!= 1 &&ch!= 2 &&ch!= 3 ) system("cls") if(ch== 3 ) return 0 else if(ch== 1 ) ReaderPriority("thread.dat") else WriterPriority("thread.dat") printf("\nPress Any Key to Coutinue:") _getch() system("cls") } return 0
上傳時間: 2017-01-06
上傳用戶:gonuiln
//獲得當前的模式 oldmode = vga_getcurrentmode[] //初始化 vga_init[] //判斷是否支持該模式 if[vga_hasmode[mode]] vga_setmode[mode] else { printf["No such mode\n"] exit[1] } //取得信息 width = vga_getxdim[] height = vga_getydim[] colors = vga_getcolors[] //繪圖 for[i=0 i<colors i++]{ vga_setcolor[i] vga_drawline[0, i, width-1, i] }
標簽: vga_getcurrentmode vga_init oldmode vga_ha
上傳時間: 2014-12-19
上傳用戶:maizezhen
//獲得當前的模式 oldmode = vga_getcurrentmode[] //初始化 vga_init[] //判斷是否支持該模式 if[vga_hasmode[mode]] vga_setmode[mode] else { printf["No such mode\n"] exit[1] } //獲得當前的模式 mode = vga_getcurrentmode[] info = vga_getmodeinfo[mode]
標簽: vga_getcurrentmode vga_init oldmode vga_ha
上傳時間: 2017-03-24
上傳用戶:ecooo
快速排序(Quick Sort)是一種有效的排序算法。雖然算法在最壞的情況下運行時間為O(n^2),但由于平均運行時間為O(nlogn),并且在內存使用、程序實現復雜性上表現優秀,尤其是對快速排序算法進行隨機化的可能,使得快速排序在一般情況下是最實用的排序方法之一??焖倥判虮徽J為是當前最優秀的內部排序方法
上傳時間: 2017-03-31
上傳用戶:shinesyh
參數化分頻器,以5為例,能很方便的擴展到參數N
上傳時間: 2017-05-25
上傳用戶:libenshu01
//顏色初始化 if(!has_colors() || start_color() == ERR){ endwin() printf("Terminal does not support color.\n") exit(1) } init_pair(1, COLOR_GREEN, COLOR_BLACK) init_pair(2, COLOR_RED, COLOR_BLACK) init_pair(3, COLOR_CYAN, COLOR_BLACK) init_pair(4, COLOR_WHITE, COLOR_BLACK) init_pair(5, COLOR_MAGENTA, COLOR_BLACK) init_pair(6, COLOR_BLUE, COLOR_BLACK) init_pair(7, COLOR_YELLOW, COLOR_BLACK) //寫字符串 for(i = 1 i <= 7 i++) { attron(COLOR_PAIR(i)) printw("color pair d in normal mode\n", i) } for(i = 1 i <= 7 i++) { attron(COLOR_PAIR(i) | A_BLINK | A_UNDERLINE) printw("color pair d in normal mode\n", i) }
標簽: start_color has_colors Terminal endwin
上傳時間: 2014-01-14
上傳用戶:vodssv
//初始化 if(initscr() == NULL) { perror("initcurs") exit(EXIT_FAILURE) } //設置模式 cbreak() noecho() keypad(stdscr, TRUE) //建立窗口 win = newwin(h, w, 3, 20) box(win, 0, 0) keypad(win, TRUE) wmove(win, cury, curx) mvaddstr(16, 1, "Press arrow keys to move the cursor within the window.\n") mvaddstr(17, 1, "Press q to quit.\n") refresh() wrefresh(win)
標簽: EXIT_FAILURE initcurs initscr perror
上傳時間: 2013-12-20
上傳用戶:FreeSky
//初始化 initscr() //獲得屏幕尺寸 getmaxyx(stdscr, h, w) //畫背景 for(i=0 i<h i++) for(j=0 j<w j++){ mvaddch(i, j, ACS_CKBOARD) } refresh() //建立窗口 pad = newpad(80, 128) for(i=0 i<80 i++){ char line[128] sprintf(line, "This line in pad is numbered d\n", i) mvwprintw(pad, i, 0, line) } //刷新屏幕 refresh() prefresh(pad, 0, 1, 5, 10, 20, 45) for(i=0 i<50 i++){ prefresh(pad, i+1, 1, 5, 10, 20, 45) usleep(30000) } //等待按鍵 getch()
標簽: getmaxyx initscr stdscr for
上傳時間: 2014-08-30
上傳用戶:龍飛艇