Count the number of times a number appears in an array

前端 未结 6 1351
我在风中等你
我在风中等你 2021-01-20 15:48

I\'m working on a small program that counts the number of times an integer appears in an array. I managed to do this but there is one thing I can\'t overcome.

My cod

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-20 16:24

    #include
    #include
    
    int main()
    {
      int arr[] = {2, 5, 0, 5, 5, 66, 3, 78, -4, -56, 2, 66, -4, -4, 2, 0, 66, 17, 17, -4};
      int arrSize = sizeof(arr)/sizeof(arr[0]);
      int tracker[20];
      int i,j,k=0,l=0,count,exists=0;
    
      for (i=0;i

提交回复
热议问题