Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- int t, s, d, e, i = 0, g = 999;
- while (g != 10000) {
- g++;
- t = g / 1000;
- s = g / 100 % 10;
- d = g / 10 % 10;
- e = g % 10;
- if (t + s + d + e == 15) {
- i++;
- cout << g << endl;
- }
- }
- cout << "Quintity = " << i;
- return 0;
- }
Add Comment
Please, Sign In to add comment