SHARE
TWEET

Untitled

a guest Oct 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int a, b,c,d,n;
  6. cin >> a >> b>> c >>n ;
  7. while(n > 0) {
  8. d = (a + b + c) % 10;
  9. a = b;
  10. b = c;
  11. c = d;
  12. n--;
  13. }
  14. cout << d <<endl;
  15. return 0;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top