-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrequency_2.fprg
50 lines (50 loc) · 2.26 KB
/
frequency_2.fprg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="Praneeth Reddy"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-01-19 12:17:21 PM"/>
<attribute name="created" value="UHJhbmVldGggUmVkZHk7UFJBTkVFVEgtUEM7MjAyMS0xMi0yNzswMjo0OTozMSBQTTszNDMw"/>
<attribute name="edited" value="UHJhbmVldGggUmVkZHk7UFJBTkVFVEgtUEM7MjAyMi0wMS0xOTsxMjoxNzoyMSBQTTs3OzM1Mzk="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="size, i, max, n, c" type="Integer" array="False" size=""/>
<output expression=""enter the number of integers"" newline="True"/>
<input variable="size"/>
<assign variable="max" expression="0"/>
<declare name="count" type="Integer" array="True" size="size"/>
<output expression=""enter the numbers"" newline="True"/>
<for variable="i" start="0" end="size-1" direction="inc" step="1">
<input variable="count[i]"/>
</for>
<for variable="i" start="0" end="size-1" direction="inc" step="1">
<if expression="count[i]>max">
<then>
<assign variable="max" expression="count[i]"/>
</then>
<else/>
</if>
</for>
<for variable="n" start="0" end="max" direction="inc" step="1">
<assign variable="c" expression="0"/>
<for variable="i" start="0" end="size-1" direction="inc" step="1">
<if expression="count[i]==n">
<then>
<assign variable="c" expression="c+1"/>
</then>
<else/>
</if>
</for>
<if expression="c==0">
<then/>
<else>
<output expression=""the count of "&n&" is "&c" newline="True"/>
</else>
</if>
</for>
</body>
</function>
</flowgorithm>