Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- temperatures_in >> low >> high;
- tempMin=low;
- tempMax=high;
- getLocation(temperatures_in, location);
- while(!temperatures_in.eof()){
- temperatures_out << left << setw(20) << location;
- temperatures_out << right << fixed << showpoint << setprecision(2) << setw(6) << low << setw(6) << high << endl;
- temperatures_in >> low >> high;
- getLocation(temperatures_in, location);
- if(low<tempMin){
- tempMin=low;
- }
- if(high>tempMax){
- tempMax=high;
- }
- cout << low << " " << tempMin << " " << high << " " << tempMax << " " << location;
- }
- void getLocation(ifstream &temperatures_in, string &location){
- char a;
- temperatures_in.get(a);
- while(a==' '){
- temperatures_in.get(a);
- }
- location="";
- while(a!='n'){
- location+=a;
- temperatures_in.get(a);
- }
- }
Add Comment
Please, Sign In to add comment