




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、函數(shù)大全(t開頭)函數(shù)名: tan 功 能: 正切函數(shù) 用 法: double tan(double x); 程序例: #include <stdio.h> #include <math.h> int main(void) double result, x; &
2、#160;x = 0.5; result = tan(x); printf("The tan of %lf is %lfn", x, result); return 0; 函數(shù)名: tanh
3、 功 能: 雙曲正切函數(shù) 用 法: double tanh(double x); 程序例: #include <stdio.h> #include <math.h> int main(void) double result, x; x = 0.5;
4、160; result = tanh(x); printf("The hyperbolic tangent of %lf is %lfn", x, result); return 0; 函數(shù)名: t
5、ell 功 能: 取文件指針的當前位置 用 法: long tell(int handle); 程序例: #include <string.h> #include <stdio.h> #include <fcntl.h> #include <io.h> int main(void)
6、 int handle; char msg = "Hello world" if (handle = open("TEST.$", O_CREAT | O_TEXT | O_APPEND) = -1)
7、160; perror("Error:"); return 1; write(handle, msg, strlen(msg); printf("The file pointer is at byte %ldn&qu
8、ot;, tell(handle); close(handle); return 0; 函數(shù)名: textattr 功 能: 設置文本屬性 用 法: void textattr(int attribute); 程序例:
9、60; #include <conio.h> int main(void) int i; clrscr(); for (i=0; i<9; i+) textattr(i + (i+1)&
10、#160;<< 4); cprintf("This is a testrn"); return 0; 函數(shù)名: textbackground 功 能: 選擇新的文本背
11、景顏色 用 法: void textbackground(int color); 程序例: #include <conio.h> int main(void) int i, j; clrscr(); for (i=0; i<9; i+)
12、160; for (j=0; j<80; j+) cprintf("C"); cprintf("rn");
13、0; textcolor(i+1); textbackground(i); return 0; 函數(shù)名: textcolor 功 能: 在文本模式中選擇新的字符顏色 用 法: void
14、 textcolor(int color); 程序例: #include <conio.h> int main(void) int i; for (i=0; i<15; i+) textcolor(i);
15、60; cprintf("Foreground Colorrn"); return 0; 函數(shù)名: textheight 功 能: 返回以像素為單位的字符串高度 用 法: in
16、t far textheight(char far *textstring); 程序例: #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) /* request aut
17、o detection */ int gdriver = DETECT, gmode, errorcode; int y = 0; int i; char msg80; /* initialize graphics
18、60;and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); if
19、160;(errorcode != grOk) /* an error occurred */ printf("Graphics error: %sn", grapherrormsg(errorcode); printf("Press
20、60;any key to halt:"); getch(); exit(1); /* terminate with an error code */ /* draw some text
21、0;on the screen */ for (i=1; i<11; i+) /* select the text style, direction, and size */ settex
22、tstyle(TRIPLEX_FONT, HORIZ_DIR, i); /* create a message string */ sprintf(msg, "Size: %d", i); /* output
23、;the message */ outtextxy(1, y, msg); /* advance to the next text line */ y += textheight(msg); &
24、#160; /* clean up */ getch(); closegraph(); return 0; 函數(shù)名: textmode 功 能: 將屏幕設置成文本模式 用
25、160;法: void textmode(int mode); 程序例: #include <conio.h> int main(void) textmode(BW40); cprintf("ABC"); getch(); textmode(C40);
26、; cprintf("ABC"); getch(); textmode(BW80); cprintf("ABC"); getch(); textmode(C80); cprintf("ABC");
27、0; getch(); textmode(MONO); cprintf("ABC"); getch(); return 0; 函數(shù)名: textwidth 功 能: 返回以像素為單位的字符串寬度 用 法
28、: int far textwidth(char far *textstring); 程序例: #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) /* request&
29、#160;auto detection */ int gdriver = DETECT, gmode, errorcode; int x = 0, y = 0; int i; char msg80; /*
30、60;initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult()
31、; if (errorcode != grOk) /* an error occurred */ printf("Graphics error: %sn", grapherrormsg(errorcode);
32、60; printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ y
33、;= getmaxy() / 2; settextjustify(LEFT_TEXT, CENTER_TEXT); for (i=1; i<11; i+) /* select the text style, direction, an
34、d size */ settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); /* create a message string */ sprintf(msg, "Size: %d",
35、60;i); /* output the message */ outtextxy(x, y, msg); /* advance to the end of the text */ &
36、#160; x += textwidth(msg); /* clean up */ getch(); closegraph(); return 0; 函數(shù)名: ti
37、me 功 能: 取一天的時間 用 法: logn time(long *tloc); 程序例: #include <time.h> #include <stdio.h> #include <dos.h> int main(void) time_t t;
38、60; t = time(NULL); printf("The number of seconds since January 1, 1970 is %ld",t); return 0; 函數(shù)名: tmpfile 功
39、 能: 以二進制方式打開暫存文件 用 法: FILE *tmpfile(void); 程序例: #include <stdio.h> #include <process.h> int main(void) FILE *tempfp; tempfp = tmpfile();
40、 if (tempfp) printf("Temporary file createdn"); else printf("Unable to create temporary filen"
41、); exit(1); return 0; 函數(shù)名: tmpnam 功 能: 創(chuàng)建一個唯一的文件名 用 法: char *tmpnam(char *sptr); 程序例:
42、160; #include <stdio.h> int main(void) char name13; tmpnam(name); printf("Temporary name: %sn", name); return 0; &
43、#160; 函數(shù)名: tolower 功 能: 把字符轉(zhuǎn)換成小寫字母 用 法: int tolower(int c); 程序例: #include <string.h> #include <stdio.h> #include <ctype.h> int main(void)
44、60; int length, i; char *string = "THIS IS A STRING" length = strlen(string); for (i=0; i<length; i+) stringi = tolower(stringi); printf("%sn
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 都勻三中小升初數(shù)學試卷
- 奉化今年高考數(shù)學試卷
- 2025年05月四川成都市青白江區(qū)婦幼保健院第二季面向社會招聘編外人員8人筆試歷年專業(yè)考點(難、易錯點)附帶答案詳解
- 2025年云南迪慶州德欽縣人民醫(yī)院招聘編外影像技術(shù)專業(yè)人員(1人)筆試歷年專業(yè)考點(難、易錯點)附帶答案詳解
- 防暑知識培訓課件
- 2025至2030純凈水零售行業(yè)發(fā)展趨勢分析與未來投資戰(zhàn)略咨詢研究報告
- 湖南興湘科技創(chuàng)新有限公司招聘筆試真題2024
- 2024年衡水深州市市直機關(guān)選調(diào)筆試真題
- 港北區(qū)分班考數(shù)學試卷
- 福州名校聯(lián)考數(shù)學試卷
- 2025年廣東省高考生物試題
- 垃圾爐渣廠管理制度
- 2025安全生產(chǎn)月一把手講安全公開課主題宣講三十三(60P)
- 2025至2030中國二甲醚汽車行業(yè)市場分析及競爭形勢與發(fā)展前景預測報告
- 統(tǒng)編版七年級歷史上冊期末復習課件
- 2025春季學期國開電大本科《人文英語4》一平臺機考真題及答案(第五套)
- 2025至2030中國匹克球市場前景預判與未來發(fā)展形勢分析報告
- 2025三明市三元區(qū)輔警考試試卷真題
- 新生兒高膽紅素血癥護理措施
- 防護窗拆除合同范本
- 關(guān)于問責的工作報告
評論
0/150
提交評論