Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
#include
#include
#include

using namespace std;

void Nuskaito (int A[],int &n) {
ifstream fd("muge.txt");
fd>>n;
for (int i=0; i>A[i];
fd.close;
}
int Suma(int A[],int n){
int s=0;
for (int i=0; i50)K++;
return K;
}
int main(){

int n;
int A[50];
Nuskaito(A,n);
for (int i=0;i<n;i++)
cout="" <<a[i]<<endl;
="" <<fixed<<setprecision(1)<<(double)suma(a,n)="" n<<endl;
="" return="" 0;
}

exercise:
number="" of="" farmers="" participating="" in="" the="" autumn="" fair="" recorded="" first="" line="" initial="" data="" file="" "muge.txt"="" n="" (n="" &lt;50).="" following="" lines="" contain="" one="" integer="" -="" how="" many="" kilograms="" potatoes="" are="" used="" by="" farmer.prepare="" a="" program="" that="" calculates:="" a.="" were="" sold="" total;="" b.="" several="" more="" than="" 50="" kg="" potatoes;="" c.="" average="" single="" farmer="" to="" decimal="" place.

<b="">What I have tried:

Error:
line 12: statement cannot resolve adress of overloaded function
Warning:
line 31: this 'for' clause does not guard ...{-Wmisleading-indentation}
Note:
line 33 this statement,but the latter is misleadingly indented as if it is guarded
Posted
Updated 18-Apr-20 2:23am
v2
Comments
Patrice T 17-Apr-20 15:56pm    
The code have been corrupted during copy/paste
Use Improve question to update your question.

1 solution

This line
Quote:
void Nuskaito (int A[],int &n);
Should be instead
C++
void Nuskaito (int A[],int &n) {
 
Share this answer
 
Comments
OriginalGriff 17-Apr-20 16:45pm    
Dat's de bunny! :thumbsup:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900