Mike_be

shit

Dec 17th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.43 KB | None | 0 0
  1. // ConsoleApplication11.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5.  
  6. #include <string>
  7. #include <iostream>
  8. #include <fstream>
  9.  
  10.  
  11. using namespace std;
  12. class Temp {
  13. public:
  14.     int Nums;
  15.     double val;
  16.     char M;
  17.     Temp() {};
  18.     //Temp(int num, double Val, int mm) :Nums(num), val(Val), M(mm) {}
  19.     //Temp() :Nums(1), val(1.001), M('K') {}
  20.     void Num(int ExNum)
  21.     {
  22.         Nums = ExNum;
  23.     }
  24.  
  25.     int GetNum()
  26.     {
  27.         return Nums;
  28.     }
  29.  
  30.     void Value(double value)
  31.     {
  32.         val = value;
  33.     }
  34.  
  35.     double getval()
  36.     {
  37.         return val;
  38.     }
  39.     void meas(char c)
  40.     {
  41.         M = c;
  42.     }
  43.     char gm()
  44.     {
  45.         return M;
  46.     }
  47.  
  48.  
  49.  
  50.  
  51. };
  52.  
  53. ostream& operator<< (ostream& os, const Temp& tm)
  54. {
  55.     os << tm.Nums << " - number of your experiment" << endl << tm.val << " -  your temperature's value " << endl << tm.M << " - your measure";
  56.     return os;
  57. }
  58.  
  59. istream& operator>> (istream& is, Temp& tm)
  60. {
  61.     is >> tm.Nums >> tm.val >> tm.M;
  62.     return is;
  63. }
  64.  
  65. int main() {
  66.     Temp temp1;
  67.     cin >> temp1;
  68.     string in;
  69.     cout << "enter type of input: (file/keyboard) ";
  70.     cin >> in;
  71.     while (in != "file"&&in != "keyboard")
  72.     {
  73.         cout << "enter way of input: (file/keyboard) ";
  74.         cin >> in;
  75.     }
  76.     if (in == "keyboard")
  77.     {
  78.         cout << "";
  79.         cout << endl;
  80.  
  81.     }
  82.     else
  83.     {
  84.         ifstream fin;
  85.         fin.open("input.txt");
  86.         ofstream fout;
  87.         fout.open("output.txt");
  88.         //fin >> "";
  89.  
  90.         fout << "";
  91.  
  92.         fin.close();
  93.         fout.close();
  94.     }
  95.     system("pause");
  96.  
  97.  
  98.  
  99. }
Advertisement
Add Comment
Please, Sign In to add comment