1 28
100%
Actual Size
Fit Width
Fit Height
Fit Page
Automatic
1 第 6 章 庫存函式 程式設計與生活-使用 C 語言 Shi-Huang Chen Spring 2013 樹德科技大學 資訊工程學系 Dept. of CSIE, Shu-Te University 2 第 6 章 庫存函式 6-1 常用庫存函式 6-2 數學運算函式 6-3 字元轉換及字元分類函式 6-4 時間與日期函式 6-5 聲音函式 6-6 停滯函式
STU C Lang CH06
Upload
others
View
5
Download
0
Embed Size (px)
344 x 292
429 x 357
514 x 422
599 x 487
Citation preview
Microsoft PowerPoint - STU_C_Lang_CH06.ppt2
3
(function)
4
()
5
6
Dept. of CSIE, Shu-Te University
7
8
9
Dept. of CSIE, Shu-Te University
10
system("pause"); //
return 0;//
11
fmax(x ,
12
fmin()
fmin( x ,
13
double num1, num2, max, min; printf("num1,num2:");
scanf("%lf,%lf",&num1,&num2); max=fmax(num1,num2); min=
fmin(num1,num2); printf("%f%f\n", max, min); system("pause"); //
return 0;//
}
:-1,2.3
14
round( )
15
}
16
:11
17
floor( )
18
double money,gift; printf(":"); scanf("%lf",&money); gift =
floor(money /1000)*100; printf("%.0f\n", gift); system("pause"); //
return 0;//
}
19
20
ceil( )
21
double hour,money; printf(":"); scanf("%lf",&hour);
money=ceil(hour)*20; printf("%.1f,%.0f\n", hour, money);
system("pause"); // return 0;//
}
22
23
pow( )
pow(x,
24
Dept. of CSIE, Shu-Te University
25
26
Dept. of CSIE, Shu-Te University
27
#include <stdio.h> #include <stdlib.h> #include
<math.h> int main() {
}
28
ax2+bx+c=0-3.000000-3.000000
29
30
31
32
}
33
34
35
36
37
38
39
40
0 NUL '\x00 ' (string)
3 EXT '\x03'
(beep)
41
8 BS '\x08' '\b'
Dept. of CSIE, Shu-Te University
42
43
44
#include <stdio.h> #include <stdio.h> #include
<stdlib.h> #include <ctype.h> int main() {
char string[81]; int length=0; // int digit=0; // int lowercase=0;
// int uppercase=0; //
Dept. of CSIE, Shu-Te University
45
//ascii>127:
46
i++; }
47
}
48
_beep(
49
Do Do# Re Re# Mi Fa
50
Do Do# Re Re# Mi Fa
51
Do Do# Re Re# Mi Fa
52
53
//_beepstdlib.h,,
55
_beep(392,500); //533 _beep(330,500); _beep(330,1000);
56
LOAD MORE