fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void afisareSolutii(int c) {
  5. for (int x = 0; x < c; ++x) {
  6. for (int y = x; y < c; ++y) {
  7. int z = c - x - y;
  8. if (z >= y) {
  9. cout << x << " " << y << " " << z << "\n";
  10. }
  11. }
  12. }
  13. }
  14. int main() {
  15. afisareSolutii(3);
  16. }
Success #stdin #stdout 0.01s 5408KB
stdin
Standard input is empty
stdout
0 0 3
0 1 2
1 1 1