Skip to content

Commit

Permalink
Update ex6_12.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy authored and pezy committed Jun 22, 2015
1 parent a1b2dcf commit 98ed994
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ch06/ex6_12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//! version do you think would be easier to use and why?
// The version using reference is easier.
//!


#include <iostream>
#include <string>

Expand All @@ -21,14 +19,11 @@ void swap(int& lhs, int& rhs)

int main()
{
int left, right;
std::cout << "Please Enter:\n";
while (std::cin >> left >> right)
for (int left, right; std::cout << "Please Enter:\n", std::cin >> left >> right; )
{
swap(left, right);
std::cout << left << " " << right << std::endl;
}

return 0;
}

0 comments on commit 98ed994

Please sign in to comment.