Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <sstream>
  5.  
  6. unsigned int answering( unsigned int &m ,unsigned int &n ) {
  7.     if (m == 0) {
  8.         return n + 1;
  9.     }
  10.     if ((m > 0) && (n == 0)) {
  11.         return answering( m - 1, 1);
  12.     }
  13.     if ((m > 0) && (n < 0)) {
  14.         return answering(m - 1,answering(m, n - 1));
  15.     }
  16.     std::ofstream fout("D:\lab rab\2_5(j).txt");
  17.     std::cout << "Ответ " << answering;
  18.     fout.close();
  19. }
  20.  
  21. int main() {
  22.     setlocale(LC_ALL, "Russian");
  23.     int m, n;
  24.     int a[2];
  25.     std::ifstream fin("D:\lab rab\2_5(j).txt");
  26.     m = a[0];
  27.     n = a[1];
  28.     fin.close();
  29.     answering(m, n);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement