current position:Home>How to solve this problem? The read data is invalid

How to solve this problem? The read data is invalid

2022-02-03 02:32:53 CSDN Q & A

#include
using namespace std;
int main()
{
long int *mt,*en,*ph,i,*sum,*as;
long int a,b,c,d,e;
cout << " Please enter the number of people for the grade you want \n";
cin >> a;
b = a; c = a; d = a; e = a;
mt= new long int[a];
en= new long int[b];
ph=new long int[c];
sum = new long int[d];
as = new long int[e];
for (i = 0; i < a && a<30 ; i++)
cin >> mt[i] >> en[i] >> ph[i];
sum[i] = mt[i] + en[i] + ph[i];
as[i] = sum[i] / 3;
cout << sum[i] << " " << as[i] << endl;

img

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030232508182.html

Random recommended