Constellation Knowledge Network - Preguntas y respuestas sobre Bagua - Un pequeño programa escrito en lenguaje C. Hay código. Por favor ayúdenme a cambiarlo.

Un pequeño programa escrito en lenguaje C. Hay código. Por favor ayúdenme a cambiarlo.

Este código fuente tiene muchos errores y le hice algunas modificaciones. Ha sido probado en vc y puede ejecutarse.

# incluir & ltstdio.h & gt

void F();

void r(int I

void s); ();

void p();

Void main()//controlador

{

f();< / p>

}

void F()

{

int I;

Hacer

{

printf(" \ n * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");

printf(" * * \ n ");

Printf("* 1(signo del zodíaco)* \ n ");

Printf("* 2(doce Palacio) )* \ n ");

Printf("* 3(Salir)* \ n ");

printf(" * * \ n ");

printf(" * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");

Printf("Por favor seleccione ( Palabra de entrada): ");

scanf("%d ", & ampI);

If (I! = 3)r(I);

}And(i!=3);

}

void r(int i)

{

Cambiar (uno)

{

caso 1: s(); romper;

Caso 2: p(); romper; p>

}

voids()//constelación

{

int x, y;

Hacer

p>

{

printf("\nPor favor ingrese el mes:");

scanf("%d ", & ampx);

if(x <1 | | x >12)

Printf ("\ n * *Nota: ¡Ingrese el mes correcto! * * * \n ");

} while(x & lt; 1 | | x & gt; 12);

Hacer

{

Printf("Ingrese la fecha:" );

scanf("%d ",&y);

if(y <1 | | y>31)

Printf ("\n * *Nota: ¡Ingrese la fecha correcta! * * * \ n ");

} while(y & lt; 1 | | y & gt; 31);

Printf("%d mes %d día es: ", x, y);

if((x = = 3&&<=31.&y>= 21)| <=19.&y>=1))

Printf ("Aries");

else if((x = = 4&&y<= 20 &&y>= 1)| p>

else if((x = = 5&&ampy<=31. &y>=21)| gt=1))

Printf("Géminis");

else if((x = = 6&&y<=31.

&y>= 22)|

si no((x = = 7&&y<=31.&y>=23)| 1))

Printf("Leo");

else if((x = = 8 &&y<=31.&y>=23)| |(x = = 9&&y<= 22&&y>=1))

Printf("Virgo");

else if(( x = = 9&&y<=31.&ampy>=23)|

Printf("Libra");

else if((x = = 10 & ; &y & lt=31 &y & gt= 24)| &y>=22)| & gt=1))

Printf("Capricornio");

si no((x = = 1 &&y<=31.&y>= 20) | si((x = = 2&&y<=31.

&y>= 19)|

printf(" \ n ");

}

void p()//Asesino del Zodíaco

{

int año;

Hacer

{

printf("\nIngrese año:");

scanf(" %d ",&Year);

If (Año& lt= 0 | |Año& gt9999)

Printf("\n***Nota: ¡Ingrese el año correcto! * * * \ n ");

} while(año & lt; = 0 | | año & gt9999);

Printf("%d año es: ", año) ;

año = año % 12;

if(año==0)

Printf("Año del mono");

if( año==1)

Printf("Año del Gallo");

if(año==2)

Printf("Año del Perro ") ;

if(año==3)

Printf("Año del Cerdo");

if(año==4)

Printf("Año de la Rata");

if(año==5)

Printf("Año del Buey");

if(año== 6)

Printf("Año del Tigre");

if(año==7)

Printf( "Año del Conejo");

if(año==8)

Printf("Año del Dragón");

if(año= =9)

Printf("Año de la Serpiente");

if(año==10)

Printf("Año del Caballo");

if(año==11)

Printf("Año de la Oveja");

printf(" \ n ");

}

上篇: ¿Es exacto gastar dinero para adivinar el futuro? 下篇: El duque de Zhou enterró vivo al niño_¿Qué significa duque Zhou?
Artículos populares