• В массиве имеются целые и дробные числа. Подсчитать количество целых и дробных. 9 класс

Ответы 1

  • #include<iostream>

    using namescacestd;

    int main()

    {

    int size;

    float sum=0;

    cout<<"pls enter count your array"<<endl;

    cin>>size;

    float **arr = new float *[size];

    for (int v = 0; v < size; v++)

     arr[v] = new float[size];

    cout<<"pls enter your  array"<<endl;

    for(int i=0;i<size;i++)

    for(int j=0;j<size;j++)

    {

    cout<<"arr["<<i<<"]["<<j<<"] = ";

    cin>>arr[i][j];

    cout<<endl;

    sum=sum+arr[i][j];

    }

    cout<<"Sum array = "<<sum<<endl;

    free(array);

    system("pause");

    return 0;

    }

    • Автор:

      spicy
    • 5 лет назад
    • 0
  • Добавить свой ответ

Еще вопросы

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years