How can I remove the string and keep the code working, any suggestions?

  c++, string

I would like to remove the string and keep the code working, I am new to this and I am learning on my own so I’m not really an expert by any means, so if you give me some suggestions that be would really helpful, thanks in advance.

Sorry If I’m not using the forum/platform correctly in some way.

#include <iostream>
#include <string>
using namespace std;

int main(){
    
    int a[] = {2,5,8,5,4,2,3,7,6,5,4,8,9,5,2,5,1};
    int b = sizeof(a)/sizeof(int);
    int count =0;
    double suma = 0;
    double media = 0;
    
    int valor = 0;
    int valor2 = 0;
    int temporal[b];
    
    for(int i = 0; i < b; i++){
        count++;
        suma += a[i];
        cout << count <<" : " <<a[i] << endl;
        
        valor = a[i];
        for(int j=0; j < b; j++){
            if(a[j] == valor){
                valor2++;
            }
        }
        
    }
    
    media = suma / count;
    cout << media;
    
    
    
}

that is the code.

Source: Windows Questions C++

LEAVE A COMMENT