💻 Hacer un programa que ingrese un número del 1 al 4 y muestre a que estación del año pertenece en Perú.
1 = VERANO
2 = OTOÑO
3 = INVIERNO
4 = PRIMAVERA
Algoritmo programacion_work
Definir estacion como Entero;
Escribir "03. MUESTRA LAS ESTACIONES DEL AÑO";
Escribir "";
Escribir Sin Saltar "INGRESE UN NÚMERO DEL [1 AL 4] : ";
Leer estacion;
Segun (estacion) hacer
1 : Escribir "ES VERANO";
2 : Escribir "ES OTOÑO";
3 : Escribir "ES INVIERNO";
4 : Escribir "ES PRIMAVERA";
FinSegun
FinAlgoritmo
print("MOSTRAR LAS ESTACIONES DEL AÑO")
estacion = int(input("INGRESE UN NÚMERO DEL [1 AL 4] : "))
if estacion == 1:
print("ES VERANO")
elif estacion == 2:
print("ES OTOÑO")
elif estacion == 3:
print("ES INVIERNO")
elif estacion == 4:
print("ES PRIMAVERA")
#include<stdio.h>
int main() {
int estacion;
printf("03. MUESTRA LAS ESTACIONES DEL ANIO.\n\n");
printf("INGRESE UN NÚMERO DEL [1 AL 4] : ");
scanf("%d",&estacion);
switch(estacion){
case 1 : printf("ES VERANO"); break;
case 2 : printf("ES OTONIO"); break;
case 3 : printf("ES INVIERNO"); break;
case 4 : printf("ES PRIMAVERA"); break;
}
return 0;
}
#include<iostream>
using namespace std;
int main() {
int estacion ;
cout << "03. MUESTRA LAS ESTACIONES DEL ANIO." << endl;
cout << "INGRESE UN NÚMERO DEL [1 AL 4] : ";
cin >> estacion ;
switch(estacion){
case 1 : cout << "ES VERANO" << endl; break;
case 2 : cout << "ES OTONIO" << endl; break;
case 3 : cout << "ES INVIERNO" << endl; break;
case 4 : cout << "ES PRIMAVERA" << endl; break;
}
return 0;
}
package programacion_work;
import java.util.Scanner;
public class muestra_estaciones {
public static void main(String[] args) {
int estacion ;
Scanner ingreso=new Scanner(System.in);
System.out.print("INGRESE UN NÚMERO DEL [1 AL 4] : ");
estacion = Integer.parseInt(ingreso.next());
switch(estacion){
case 1 : System.out.println("ES VERANO"); break;
case 2 : System.out.println("ES OTOÑO"); break;
case 3 : System.out.println("ES INVIERNO"); break;
case 4 : System.out.println("ES PRIMAVERA"); break;
}
}
}