Skip to content

Commit a548c23

Browse files
Merge pull request #2 from Chau-Nguyen-Developer/readFile
Fixed the bugs. Could not print out vector 4 before.
2 parents 7eefadc + 51dbec8 commit a548c23

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

programming4.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,18 @@ int main()
6868
std::cout << "This is vector 3" << std::endl;
6969
for(size_t i = 1; i < vector1.size(); ++i)
7070
{
71-
std::cout << (vector2[i] - vector2[i-1]) / (vector1[i] - vector1[i-1]) << std::endl;
71+
vector3.push_back((vector2[i] - vector2[i-1]) / (vector1[i] - vector1[i-1]));
72+
std::cout << vector3[i-1] << std::endl;
7273
}
7374

7475
std::vector<double> vector4;
7576
std::cout << "This is vector 4" << std::endl;
7677
std::cout <<"print out"<< std::endl;
77-
78+
7879
for(size_t i = 1; i < vector3.size(); ++i)
7980
{
80-
std::cout << (vector3[i] - vector3[i-1]) / (vector1[i+1] - vector1[i-1]) << std::endl;
81+
vector4.push_back((vector3[i] - vector3[i-1]) / (vector1[i+1] - vector1[i-1]));
82+
std::cout << vector4[i-1] << std::endl;
8183
}
8284

8385

programming4.exe

512 Bytes
Binary file not shown.

programming4.obj

1.89 KB
Binary file not shown.

0 commit comments

Comments
 (0)