• Написать программу на языке Си++
    В целочисленном массиве В (4,3) заменить все его элементы их квадратами

Ответы 1

  • #include <iostream>#include <cstdlib>using namespace std;int main() {    int i,j;    int a[4][3];    for (i=0; i<4; i++){        cout<<"Stroka "<<i+1<<endl;        for (j=0; j<3; j++) {            cout<<"Element "<<j+1<<": ";            cin>>a[i][j];        }        cout<<endl;    }    cout<<"Resul'tat"<<endl;    for (i=0; i<4; i++) {        for (j=0; j<3; j++) {            a[i][j]*=a[i][j];            cout<<a[i][j]<<" ";        }        cout<<endl;    }    cin>>i; //ïðîñòî ÷òîáû ýêðàí íå çàêðûëñÿ    return 0;}Тестовое решение (Dev C++)Stroka 1Element 1: 1Element 2: 2Element 3: 3Stroka 2Element 1: 4Element 2: 5Element 3: 6Stroka 3Element 1: 7Element 2: 8Element 3: 9Stroka 4Element 1: 10Element 2: 11Element 3: 12Resul'tat1 4 916 25 3649 64 81100 121 144:
  • Добавить свой ответ

Еще вопросы

Войти через Google

или

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

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

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