// nopar.cpp: Using a function without parameters
#include <iostream>
using namespace std;

double readreal() {

 double x;
 char ch;
  
  for (;;) {
    cin >> x;
     if (!cin.fail())
      break;
    cin.clear();
    do ch = cin.get(); while (ch != '\n');
    cout << "Incorrect number:\n";
  }
 return x;
}

int main() {

 double xx;
 float x;
 cout << "Enter a real number: ";
 xx == readreal();
 cout << "Another one, please: ";
 x = readreal();
 cout << "The following numbers have been read: "
      << xx << " " << x << endl;
 return 0;
}

