void Main() - PowerPoint PPT Presentation

1 / 59
About This Presentation
Title:

void Main()

Description:

Title: PowerPoint Author: xhl Last modified by: User Created Date: 12/31/1997 4:42:47 PM Document presentation format: – PowerPoint PPT presentation

Number of Views:84
Avg rating:3.0/5.0
Slides: 60
Provided by: xhl1
Category:
Tags: bcpl | main | powerpoint | void

less

Transcript and Presenter's Notes

Title: void Main()


1
???
??????
??
??
????
??????
??
??????
2
3.1 ??
  • ?????
  • ??
  • ??

3
? ?????
????????????????,??????????????
????
????
4
? ??
?????,?????????????????????????,
void Main() int i,j,l for(i 0
ilt8i) for(l0 lltil) printf(" ")
for(j8-ijgt0j--) printf(" ")
printf("\n")
5
? ??
????????????????????
? 3.2 ?????
? 3.3 ?????
? ? ? ??????.?? ????.?.?.?.??.??. ??? ??
  1.?????,???????. 2.??????????????
3.???.??.?.???.????. 4.????.?.?????????,???,????
.
6
???????????
  • ?????????????????,?????????????????
  • ???????????????????,??????????????????
  • ????????????????????,?????????????????????????

7
3.2 ??
  • ???????
  • ?????
  • ??????

8
? ???????
  • ????
  • ????
  • ????
  • ????????

9
????
  • ???????????????????????
  • ??????????????,??????????????????????????????

10
????
?????????????????
  • ???
  • ???
  • ?0??????
  • ?1??????
  • ???

???????????????
???????????,??0?????????????????
11
????
  • ??????
  • ?????????????????
  • ?????????????(????????????????????????)
  • ??????

12
????????
  • ????????,????????
  • ?????????????,????????????????????????????????,???
    ??????????,???????????????????????,????????????

13
? ?????
  • ???????
  • ??????
  • ?N-S?????
  • ??????
  • ????????

14
???
????????????????????????
ANSI?????????????
15
N-S???
???????,???????????????,????????????.
????
????
????
16
???
  • ???????????
  • ??????????????? ?,??????,?????????,??????????????
    ???????

17
??????????????????????
Sum 0 n1 if nlt10 then sumsumn nn1
else print sum end
??????????????????????????
18
?3.4 ? y x2-2x3 ?? ? x0,1, 2,3,
4,5 ????y?
  • ???????
  • ??????
  • ?N-S???
  • ?C????

19
  • ???????
  • 1. ?x???? 0
  • 2. ?x???? n5
  • 3. ?xn?,??????3 ?, ???????
  • ?????y?
  • ????x?y??
  • x???1

20
  • ??????

? ?
0 ? x 5 ? n
x ? n ?
N
Y
y x2-2x3
? ?
??x?y?
??xx1
21
  • ?N-S???

0 ? x
5 ? n ? x ? n
? ?? y x2-2x3 ??
x?y? ??xx1 ?? x gt n
22
  • ?C????

main() int x, y, n x0 n5 while( x
lt n) yxx-2x3 printf(d d, x,
y) xx1
23
? ??????
  • ????
  • ????
  • ????
  • ??

24
??????
????
????
????
????
?????
?????????
25
??? 3-5???A?????,??B???????????????????
???? ?????A???B????????????????? ?????????Temp
????A??????????Temp ????B?????????A?? ????Te
mp???????B???
26
??? 3-6?????????,?????????
???? ????????,??a,b????????,?????max?????,???????
??????????? ??????????a,b ?????a?b ?????agtb,
??a???????max? ?????altb,??b???????max? ?????ma
x?
27
(No Transcript)
28
??? 3-7????????????????,????????!???????,??????
??,???????????,???????????
???? ????????????? ?????????,?????????! ???
???????,??????????!,??????? ???????????????,?
????
29
(No Transcript)
30
??
?? ????????,???????????????????????,??????????????
????,?????????? ????????????????????????
31
?????????????????,????????????????,??????????????
??,???????,????n??????,????????????,?????????????
?????n/2?
????????????????????,??????????????,??????????
????????????,??????????????????????????
32
??? 3-8??????????? Marry, Ann, Kelly, Black,
Carol, David, John, Hanrry, Fred, Elaine, Oliver,
George, Irene, Larry, Nancy ????????,??John?
???? ??? ?????????? ??? ????????,?????????? a)
????John????????????,????? b) ????John,????????,?
???? c) ???John,?????? ??? ??????John ??? ??
??John??????????????????7????Marry?????1?,???Nancy
?????15?????????7?
33
??? 3-9????3.8??????????????,????????????,???John?

??????????????????????,?????,????3?,???????
34
? ?
?????????????????????
?????????????????,?????????,????????????????????
??????,?????????????n???,????????n-1?,????????????
?????????,?????????????????????????
35
??? 89 21 56 48 85 16 19 47
?1??? 16 21 56 48 85 89 19 47
?2??? 16 19 56 48 85 89 21 47
?3??? 16 19 21 48 85 89 56 47
?4??? 16 19 21 47 85 89 56 48
?5??? 16 19 21 47 48 89 56 85
?6??? 16 19 21 47 48 56 89 85
?7??? 16 19 21 47 48 56 85 89
36
3.2 ????
  • ?????
  • ?????

37
? ?????
????????
38
???????
1.????
?0?1????,??????????????????
?????????????,??????? ???????????(????)??,??
???
2.????(????)
?????????????????
?????,??????,???????? ?????????????
3.????
????????????????
  • ???????,???,????,??????
  • ?????????????

39
4. ???????--- ??????????????????.?????????,???????
??? ?? ???????????????????????????????????,?????
???????(??)?????,???????????????
???????????C?PB?VF?VB?VC?Delphi?Java?.Net ???
40
???????
  • C??
  • 1972??1973??ATT??Bell????D.M.Ritchie
    ?BCPL??????????,???UNIX???????C??????
  • ??
  • ?????????????????????????????????????,C????????
    ??????????????,?C???,???????????????????,?????????
    ??????

41
???????
  • C??
  • ?C???????????????????C?????????,??????????
    Be11????B.stroustrup?1980???????,?????????
  • C????C?????,?????????????????(?Simula?ALGOL68?Ad
    a?)????????C???????????????,?????,???C?????,????
    ???C?????????C????????

42
? ?????
??????????????,?????????????????????????????,?????
??????????
??????????????,????????????????????,??????????????
???????????????????,????????????????
????????????????,??????????????????????????,??????
?
43
JavaScript???????Web???,????????JavaScript??????,?
???????????????,????????????,?????
44
????C????
45
3.4 ??????
  • ??????
  • ????????
  • ??????
  • ????

46
? ??????
?????
  • ????
  • ???
  • ??

47
program Conversion(input,output) const
inchsPerFoot 12 centimetersPerInch
2.54 var feet,inches,lengthInInches integer
centimeters real begin write('What is
the length in feet and inches?')
readln(feet,inches)
lengthInInches inchesPerFootfeet inches
centimeters centimetersPerInchlength
InInches writeln('The length in
centimeters is',centimeters12') end
????
???
48
C??????????????????
49
?????????
  • ????????????
  • ???????????????
  • ?????????????????
  • ????????????????
  • ??????????????
  • ??????????????????
  • ????????

50
program Conversion(input,output) const
inchsPerFoot 12 centimetersPerInch
2.54 var feet,inches,lengthInInches integer
centimeters real begin write('What is
the length in feet and inches?')
readln(feet,inches)
lengthInInches inchesPerFootfeet inches
centimeters centimetersPerInchlength
InInches writeln('The length in
centimeters is',centimeters12') end
??
??
????
????
51
??????
??????????????????????/??????
???? ???? ???? ???? ??????
??????????????????????
????????????
?????,?????????????
  • ??????
  • ??????
  • ??????

52
? ??????
  • ????
  • ????
  • ????
  • ????
  • ???????
  • ?????
  • ????
  • ????
  • ?????
  • ????
  • ???
  • N-S???
  • ???

53
? ????
  • ????
  • ????
  • ????
  • ??????
  • ????

54
??????
  • ?????
  • ?????

55
  • ?????

????
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10

?????????????? pj
??????? i0 n-1 ???????????? ji1 n
???? ajltap tai aiap apt
?? n?? ?? n??(????) ??a10 t i j
p
56
for(i0 iltn-1 i) pi for(ji1
jltn j) if(ajltap) pj
if(p!i) tap apai
ait
???
main() int a10,i, j, t, p for(i0 ilt10
i) scanf("d", ai)
  • ????????????
  • ??????????

for(i0 ilt10 i) printf("d",
ai)
57
?????
????
  • ???????????
  • ???????????
  • ?????????...????
  • ??????????????
  • ???????????????
  • ??????????

??
  • ?????,???????????
  • ???????,???n-1??
  • ?????????????????,
  • ?????????(?????)?

58
  • int a4 n5
  • a0 a1 a2 a3 a4
  • ??? 21 13 90 32 -1

13 21 90 32 -1
13 21 32 90 -1
13 21 32 -1 90
??? ......
??????? n??,?n-1? ?????????? j1 n
59
? ? ? ?
???? ??????????????? ????? ?
??????????????? ???????????? ?
????????3?5?1?9?6?? ????
Write a Comment
User Comments (0)
About PowerShow.com