Programacion En Tiempo Real
#include<stdio.h>
int x,n,op;
int Imprimir();
int Alta();
int Buscar();
int eliminar();
struct dato
{
char nom[20][20];
char edi[20][20];
char autor[20][20];char ano[20][20];
}
datos;
Alta()
{
clrscr();
n=n+1;
printf("NOMBRE DEL LIBRO:\n");
scanf("%s",&datos.nom[n]);
printf("EDITORIAL DEL LIBRO: \n");
scanf("%s",&datos.edi[n]);printf("AUTOR DEL LIBRO:\n");
scanf("%s",&datos.autor[n]);
printf("FECHA DE LANZAMIENTO:\n");
scanf("%s",&datos.ano[n]);
getch();
}
int Imprimir()
{
clrscr();
gotoxy(15,2);printf("NOMBRE:");gotoxy(30,2);printf("EDITORIAL:");
gotoxy(45,2);printf("AUTOR:");
gotoxy(60,2);printf("FECHA:");
for (x=1;x<=n;x++)
{
gotoxy(3,4+(2*x));printf("LIBRO: %d",x);gotoxy(15,4+(2*x));printf("%s",datos.nom[x]);
gotoxy(30,4+(2*x));printf("%s",datos.edi[x]);
gotoxy(45,4+(2*x));printf("%s",datos.autor[x]);
gotoxy(60,4+(2*x));printf("%s",datos.ano[x]);
getch();
}}
int Buscar()
{
clrscr();printf("ESCRIBE EL -NUMERO- DEL LIBRO QUE QUIERES BUSCAR: ");
scanf("%d",&x);
gotoxy(15,3);printf("NOMBRE:");
gotoxy(30,3);printf("EDITORIAL:");
gotoxy(45,3);printf("AUTOR:");gotoxy(60,3);printf("FECHA:");
gotoxy(3,4+(2*x));printf("LIBRO: %d",x);
gotoxy(15,4+(2*n));printf("%s",datos.nom[x]);
gotoxy(30,4+(2*n));printf("%s",datos.edi[x]);gotoxy(45,4+(2*n));printf("%s",datos.autor[x]);
gotoxy(60,4+(2*n));printf("%s",datos.ano[x]);
for (x=1;x<=n;x++)
getch();
}
int eliminar()
{
clrscr();
printf("ESCRIBE EL NUMERO DEL LIBRO A ELIMINAR: ");
scanf("%d",&x);gotoxy(15,2);printf("NOMBRE:");
gotoxy(30,2);printf("EDITORIAL:");
gotoxy(45,2);printf("AUTOR:");
gotoxy(60,2);printf("FECHA:");
gotoxy(3,4+(2*x));printf("LIBRO: %d",x);gotoxy(15,4+(2*n));printf("%s",datos.nom[n]);
gotoxy(30,4+(2*n));printf("%s",datos.edi[n]);
gotoxy(45,4+(2*n));printf("%s",datos.autor[n]);
gotoxy(60,4+(2*n));printf("%s",datos.ano[n]);
for (x=1;x<=n;x++)
getch();
}...
Regístrate para leer el documento completo.