Parent Directory | Revision Log
pseudo kåd för 1.5
1 | jontas | 1.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 |