Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("bac.in");
- int main()
- {
- int s1, s2;
- fin >> s1 >> s2;
- int V[5];
- for(int i = 0; i <= s1; i++)
- {
- if(i == 0)
- continue;
- V[0] = i;
- V[1] = s1-i;
- if(V[0] > 9 || V[1] > 9)
- continue;
- for(int j = 0; j <= 9; j++)
- {
- V[2] = j;
- for(int k = 0; k <= s2; k++)
- {
- V[3] = k;
- V[4] = s2-k;
- if(V[3] > 9 || V[4] > 9)
- continue;
- cout << V[0] << V[1] << V[2] << V[3] << V[4] << "\n";
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement