Lucian_Adrian

#943 Suma4

Oct 5th, 2021
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. int N,s=0,x;
  8. cin >> N;
  9. N%=100;
  10. for (int i = 1; i<= N;++i)
  11. {
  12. x=i%10;
  13. s=(s+x*x*x*x)%10;
  14.  
  15. }
  16. cout << s;
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment