fork download
  1. #include<iostream>
  2. #include<bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. unsigned int b;
  9. cin>>b;
  10. if(b!=0)
  11. {
  12. if(b%4==0)
  13. cout<<6<<endl;
  14. if(b%4==1)
  15. cout<<2<<endl;
  16. if(b%4==2)
  17. cout<<4<<endl;
  18. if(b%4==3)
  19. cout<<8<<endl;
  20. }
  21. else
  22. cout<<1<<endl;
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
1