Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. void funkcija (int&, int&);
  7. void isvedimas (int, int);
  8.  
  9. int main() {
  10.   int a, b;
  11.   funkcija(a, b);
  12.   isvedimas(a, b);
  13.   //system("pause");
  14.   return 0;
  15. }
  16.  
  17. void funkcija (int& a, int& b) {
  18.   int c;
  19.   a = 101, b = 0;
  20.   ifstream in ("duom.txt");
  21.   while (!in.eof()) {
  22.     in >> c;
  23.     if (c < a)
  24.       a = c;
  25.     if (c > b)
  26.       b = c;
  27.   }
  28.   in.close();
  29. }
  30.  
  31. void isvedimas (int a, int b) {
  32.   cout << "Minimumas yra " << a << endl;
  33.   cout << "Maksimumas yra " << b;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement