Iamtui1010

lagrange

Nov 9th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. //#include<bits/stdc++.h>
  2. #include<iostream>
  3. #include<fstream>
  4. #include<cmath>
  5.  
  6. #define long long long
  7. #define nln '\n'
  8.  
  9. const long N = 1e8+10;
  10.  
  11. using namespace std;
  12.  
  13. // Global variables: f1, f2, n
  14.  
  15. fstream f1, f2;
  16.  
  17. inline void openf()
  18. {
  19.     f1.open("lagrange.inp", ios:: in);
  20.     f2.open("lagrange.out", ios:: out);
  21. }
  22.  
  23. inline void closef()
  24. {
  25.     f1.close();
  26.     f2.close();
  27. }
  28.  
  29. long n;
  30.  
  31. void data()
  32. {
  33.     f1.tie(0)->sync_with_stdio(0);
  34.     f2.tie(0)->sync_with_stdio(0);
  35.     cin.tie(0)->sync_with_stdio(0);
  36.     cin >> n;
  37. }
  38.  
  39. void process()
  40. {
  41. }
  42.  
  43. void view()
  44. {
  45.     if (1 <= n && n <= 3)
  46.         cout << n << nln;
  47.     else
  48.         if (n >= 4 && n <= 6)
  49.             cout << 3 << nln;
  50.         else
  51.             cout << 4 << nln;
  52. }
  53.  
  54. int main()
  55. {
  56.     openf();
  57.     data();
  58.     process();
  59.     view();
  60.     closef();
  61.     return 0;
  62. }
  63.  
Advertisement
Add Comment
Please, Sign In to add comment