stu c lang ch06
TRANSCRIPT
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
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