/[cvs]/02/appendix_a.pseudo.txt
ViewVC logotype

Contents of /02/appendix_a.pseudo.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Thu Dec 11 18:50:39 2003 UTC (20 years, 10 months ago) by jontas
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
pseudo kåd för 1.5

1 int maxTemp = 0
2 int minTemp = 1000
3 int mostCommonTemp = 0
4 int noOfMostCommonTemp = 0
5 int[] commonTemp[99]
6 int[] dayTemps[noOfDays] //from the outside. already DEFINED
7 foreach int temp in commonTemp{
8 temp = 0
9 }
10 foreach int temp in dayTemps {
11 if maxTemp < temp{
12 maxTemp = temp
13 }
14 if minTemp > temp {
15 minTemp = temp
16 }
17 commonTemp[temp]++
18 }
19 for (int i = 0; i < 99; i<<){
20 if noOfMostCommonTemp < commonTemp[i]{
21 noOfMostCommonTemp = commontemp
22 mostCommonTemp = i
23 }
24 }
25 print 'max = ' maxtemp
26 print 'min = ' mintemp
27 pritn 'most common = ' mostCommonTemp

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26