


Вещественный массив на языке C++ в Windows Form
Нужно переделать этот код чтоб он работал в Windows Form
#include "stdafx.h"
#include "iostream"
#include "iomanip"
using namespace std;
int main()
{
const int n=4,m=4;
float c,a[n][m];
srand(time(0));
cout<<"C: ";
cin>>c;
for(int i=0;i< n;i++)
for(int j=0;j< m;j++)a[i][j]=(rand()%201-100)/10.;
for(int i=0;i< n;i++)
{
for(int j=0;j< m;j++)cout<<setw(8)<<a[i][j];
cout<<endl;
}
cout<<endl;
for(int j=0;j< m;j++)
for(int i=0;i< n;i++)a[i][j]=a[i][j]>0?c:0;
for(int i=0;i< n;i++)
{
for(int j=0;j< m;j++)cout<<setw(8)<<a[i][j];
cout<<endl;
}
cout<<endl;
cout<<"Press Enter for exit\n";
cin.get();
cin.get();
}
А Windows Form выглядел примерно так как на фото
Задание на 15 минут. Считываешь в массив значение боксов по очереди, потом суммируешь по ряду.
Что-то не припомню чтобы у С++ были WindowsForms)