Advertisement
Guest User

opana

a guest
Jan 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int s = 0;
  8. for(int i = 0; i < 2020; i+= 2000){
  9. for(int j = 0; j < 2020; j+= 1000){
  10. for(int k = 0; k < 2020; k+= 500){
  11. for(int z = 0; z < 2020; z+= 200){
  12. for(int x = 0; x < 2020; x+= 100){
  13. for(int y = 0; y < 2020; y+= 50){
  14. for(int q = 0; q < 2020; q+= 10){
  15. for(int w = 0; w < 2020; w+=5){
  16. if(i+j+k+z+x+y+q+w == 2020){
  17. s++;
  18. cout << i+j+k+z+x+y+q+w << endl;
  19. cout << i << " " << j << " " << k << " " << z << " " << x << " " << y << " " << q << " " << w;
  20. cout << endl;
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
  28. }
  29. }
  30. cout << s;
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement