fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. while(true) {
  7. int X,Y;
  8. cin >>X>>Y;
  9. int Z=0;
  10. int l=0;
  11. if (X<=0 || Y<=0) {
  12. return 0;
  13. if (X>Y) {
  14. for (int i=Y;i<=X;i++) {
  15. int Z=i;
  16. cout <<i<<" ";
  17. Z +=i;
  18. } cout <<"sum"<<" "<<'='<<Z<<endl;
  19. }else if (Y>X) {
  20. for (int g=X;g<=Y;g++) {
  21. int l=g;
  22. cout <<g<<" ";
  23. l +=g;
  24. } cout <<"sum"<<" "<<'='<<l<<endl;
  25. }
  26. }
  27.  
  28. return 0;}
  29. }
  30.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty