Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int s = 0;
- for(int i = 0; i < 2020; i+= 2000){
- for(int j = 0; j < 2020; j+= 1000){
- for(int k = 0; k < 2020; k+= 500){
- for(int z = 0; z < 2020; z+= 200){
- for(int x = 0; x < 2020; x+= 100){
- for(int y = 0; y < 2020; y+= 50){
- for(int q = 0; q < 2020; q+= 10){
- for(int w = 0; w < 2020; w+=5){
- if(i+j+k+z+x+y+q+w == 2020){
- s++;
- cout << i+j+k+z+x+y+q+w << endl;
- cout << i << " " << j << " " << k << " " << z << " " << x << " " << y << " " << q << " " << w;
- cout << endl;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement