/*I want conver this code to python
Write a program in C-C that walks through an array and generates a histogram based on the numbers in the array. The array is named myArray and contains 10 elements that correspond to integers from 1 to 5. A histogram represents that both an element appears in a dataset. For example, for the array: myArray:-(1,2,1,3,3,1,2,1,5,1) the histogram would look like this:
1: *****
2: **
3: **
4:
5: *
*/
Dim mayorSec As Integer = 1
Dim mayorSecAux As Integer = 1
Dim numeroMayorSec As Integer = 0
Dim numeroAux As Integer = 0
Dim i As Integer = 0
Do While (i < myArray.Length)
If (myArray(i) = numeroAux) Then
mayorSecAux = (mayorSecAux + 1)
Else
mayorSecAux = 0
End If
If (mayorSecAux > mayorSec) Then
mayorSec = mayorSecAux
numeroMayorSec = myArray(i)
End If
numeroAux = myArray(i)
i = (i + 1)
Loop
Console.WriteLine(("Longest: " _
+ (mayorSec + 1)))
Console.WriteLine(("Number: " + numeroMayorSec))
Replies to Untitled
Title |
Name |
Language |
UNIX |
When |
Re: Untitled |
Eduardo |
csharp |
1601354370 |
3 Years ago. |
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}