|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
C + + to analyze the wrong procedure at which Please [code] Established that three of the vector object, object of the first two elements corresponding to each phase together, the results of the corresponding objects placed third element, in the implementation of why, after completing a good two objects, one of the + operation on the implementation of a mistake, there are irregularities in the procedures, it should enlighten! ! !
Em09 : :
#include "Iostream>
#include "Vector>
Using namespace std;
Int main ()
-- Float a, 1997a
Int Rifa
Vector<float>x;
Vector<float> Rules
Vector "float>z;
For (i=0;i<2;i++)
{cin>>a;
X.push_back (a);
Cin>>b;
Y.push_back (b);
}
For (i=0;i<x.size () +y.size () ;i++)
Z[i]=x[i]+y[i];
For (i=0;i<x.size () ;i++)
Cout<<z[i]<< "\n";
Return 0
}
[/code] |
#include "Iostream>
#include "Vector>
Using namespace std;
Int main ()
{
Float a, 1997a
Int Rifa
Vector<float>x;
Vector<float> Rules
Vector "float>z;
For (i=0;i<2;i++)
{
Cin>>a;
X.push_back (a);
Cin>>b;
Y.push_back (b);
}
Z.resize (x.size ());
For (i=0;i<x.size () ;i++)
Z[i]=x[i]+y[i];
For (i=0;i<x.size () ;i++)
Cout<<z[i]<< "\n";
Return 0
}
This first read the next issue |
| |