De Arriba a Abajo X42360


Statement
 

pdf   zip

Escribir un programa que lea dos número xx y yy, e imprima todos los números entre xx y entre yy.

Entrada

La entrada consiste de dos números enteros xx y yy.

Salida

Imprimir todos los números enteros entre xx y yy.

Observación

  • Incluir tanto xx como yy

  • Considere el caso cuando xx > yy, no deberá imprimir nada

  • No olvide imprimir un salto de línea al final.

  • Tome el siguiente código en c++ como guía.


#include <iostream>

using namespace std;


int main() {	
	int x;
	int y;
	
	cin >> x;
	cin >> y;
	
	for(int i = x; i <= y; ++i){
		cout << i << endl;
	}
	
	return 0;
}
Public test cases
  • Input

    3 7
    

    Output

    3
    4
    5
    6
    7
    
  • Input

    -2 2
    

    Output

    -2
    -1
    0
    1
    2
    
  • Input

    1 0
    

    Output

    
            
                                
  • Input

    5 8
    

    Output

    5
    6
    7
    8
    
  • Information
    Author
    Language
    Spanish
    Official solutions
    C++
    User solutions
    C C++ Java Python