day 21 Hw
#include <iostream> #include <cmath> #include<fstream> #include<string> using namespace std; int main(void) { // fstream unknownf; // unknownf.open("unknownf.txt",ios::in | ios::out); // // if (!unknownf.is_open()) // { // cout << " File didn't open"; // } //else //{ // char word[50]; // unknownf << word; // while(unknownf.good()) // { // // } // // //unknownf.close(); //} //Declare and initialize variables. int n; double unknown[5], known[5]={6.2,7.0,8.0,7.4,5.8}; double distance(double hand_1[5],double hand_2[5]); // Compute and print distance. for(n=0;n<5;n++) { cout << "Enter elements:" << endl; cin >> unknown[n]; } fstream unknownf; unknownf.open("unknownf.txt",ios::in | ios::out); if (!unknownf.is_open()) { cout << " File didn't open"; } else { char word[50]; unknownf << word; int i=...
Comments
Post a Comment