Lucian_Adrian

Untitled

Aug 18th, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. ifstream f("2lan.in");
  8.  
  9. ofstream g("2lan.out");
  10.  
  11. int n, r,c;
  12.  
  13. int main()
  14.  
  15. {
  16. f >> n;
  17.  
  18. if (n==0) c=1;
  19.  
  20. else
  21. {
  22. r=n%4;
  23.  
  24. if (r==1) c=2;
  25.  
  26. if (r==2) c=4;
  27.  
  28. if (r==3) c=8;
  29.  
  30. if (r==0) c=6;
  31.  
  32. }
  33. g << c;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment