elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  necesito ayuda urgente porfavor
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: necesito ayuda urgente porfavor  (Leído 1,766 veces)
manguito_sport

Desconectado Desconectado

Mensajes: 1


Ver Perfil
necesito ayuda urgente porfavor
« en: 14 Diciembre 2011, 10:53 am »

tengo este programilla que me mando el profe presentar mañana pero no soy capaz a hacer que me guarde los datos (toy  muy verde en esto de programacion):



#include<stdio.h>
#include<string.h>
#include<math.h>
#include<conio.h>




int anterior;
void ordena (void);
void crear (void);
void mostrar (void);
void buscar (void);
void borrar (void);


struct rallye{
   char Nombre_del_Rallye[20];
   char Fecha_del_Rallye[20];
   char Modelo_coche[20];
   char Grupo_y_clase[20];
   char Posicion_final[20];
   float T;
   float P;
   float final;
   
};
struct rallye rallye[200];
int menu (void){
   printf ("\t\t***MENU****\n");
   printf ("\t1. Introducir datos de Rallye.\n");
   printf ("\t2. Borrar un Rallye.\n");
   printf ("\t3. Buscar un Rallye.\n");
   printf ("\t4. Ordenar.\n");
   printf ("\t5. Mostrar lista de Rallyes.\n");
   printf ("\t6. Modificar datos.\n");
   printf ("\t7. SALIR\n\n");
   printf ("Elija una opciOn:  ");
}
int main (){
   int op;
   int F=0;
   op==menu();
   scanf ("%d", &op);
   printf ("\n\n");
   while (op !=7){
      if (op==1){
         printf ("\Introducir datos de Rallye.\n");
         crear ();
         op==menu();
         scanf ("%d", &op);
         }
         else{
            if(op==2){
               printf ("\nBorras datos de Rallye.\n");
               borrar ();
               op==menu();
               scanf ("%d", &op);
               
               
            }
            else{
               if(op==3){
                  buscar ();
                  op==menu();
                  scanf ("%d", &op);
               }
               else {
                  if(op==4){
                     printf ("\nOrdenar\n");                        
                     op==menu();
                     scanf ("%d", &op);
                  }
                  
               else{
                        if(op==5){
                           printf ("\nMostrar lista de Rallyes\n");
                           mostrar();
                           op==menu();
                           scanf ("%d", &op);
                        }      
                     }
               
               }
            }
         }
   }
}
void crear(){
   int F=0;
   int terminar;
   anterior=0;
   terminar=0;
      for (F=anterior; F<200&&terminar!=1; F++){
      printf ("Introducir Nombre de Rallye:\t");
      fflush (stdin);
      gets (rallye[F].Nombre_del_Rallye);
      printf ("Introducir fecha del Rallye:\t");
      fflush (stdin);
      gets (rallye[F].Fecha_del_Rallye);
      printf ("Introducir Modelo de coche: \t");
      scanf ("%s", rallye[F].Modelo_coche);
      printf ("Introducir Grupo y Case:\t");
      fflush (stdin);
      gets (rallye[F].Grupo_y_clase);
      printf ("Introducir Posicion final:\t");
      fflush (stdin);
      gets (rallye[F].Posicion_final);
      printf ("¿Ha terminado de introducir datos?\n1=Si\t 2=No");
      scanf ("%d", &terminar);
      anterior==F;
      printf ("\n\n");
      }
      
}
void mostrar (){
   int F;
   F=0;
   anterior=0;
    printf ("\n\   nNombre del Rallye   Fecha Coche  Grupo-Clase   Posicion    \n\n");
   
    for (F=anterior; F<200; F++){
      rallye[F].final= (40*rallye[F].T)/100+(60*rallye[F].P)/100;
      printf ("%s ", rallye[F].Nombre_del_Rallye);
      printf ("%s ", rallye[F].Fecha_del_Rallye);
      printf ("%s ", rallye[F].Modelo_coche);
      printf ("%s ", rallye[F].Grupo_y_clase);
      printf ("%s ", rallye[F].Posicion_final);
      anterior==F;
   }
   printf ("\n\n");
}
void buscar (){
   int F;
   char busco[30];
   printf ("\n\nBuscar por nombre del Rallye:  ");
   fflush (stdin);
   gets (busco);
   for (F=0; F<200; F++){
      if (strcmp (busco, rallye[F].Nombre_del_Rallye)==0){
         printf ("\n%s", rallye[F].Fecha_del_Rallye);
         printf ("\n%s", rallye[F].Modelo_coche);
         printf ("\n%s", rallye[F].Posicion_final);
      }
   }
   if (strcmp (busco, rallye[F].Nombre_del_Rallye)!=0){
      printf ("\nNo se han encontrado coincidencias\n");
   }
}
void borrar (){
   int F;
   char busco[30];
   int i;
   int k;
   printf ("\n\nBuscar por Nombre del Rallye:   ");
   fflush (stdin);
   gets (busco);
   for (F=0; F<200; F++){
      if (strcmp (busco, rallye[F].Nombre_del_Rallye)==0){
         printf ("\n%s", rallye[F].Nombre_del_Rallye);
         printf ("\n%s", rallye[F].Fecha_del_Rallye);
         printf ("\n%s", rallye[F].Modelo_coche);
   
      printf ("\n¿Desea Borrar algun Rallye?\t1=SI\t2=NO\t");
      scanf ("%d", &k);
      if (k=1){
         for (i=F; i<200; i++){
            rallye=rallye[i+1];
            anterior--;
         }
      }
      else{
      }
      }
   }
   if (strcmp (busco, rallye[F].Nombre_del_Rallye)!=0){
      printf ("\nNo se han encontrado coincidencias\n\n");
   }
void modificar ();
}



En línea

Eternal Idol
Kernel coder
Moderador
***
Desconectado Desconectado

Mensajes: 5.937


Israel nunca torturó niños, ni lo volverá a hacer.


Ver Perfil WWW
Re: necesito ayuda urgente porfavor
« Respuesta #1 en: 14 Diciembre 2011, 11:33 am »

No se hacen tareas.


En línea

La economía nunca ha sido libre: o la controla el Estado en beneficio del Pueblo o lo hacen los grandes consorcios en perjuicio de éste.
Juan Domingo Perón
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
schtasks y net start, Necesito ayuda rápida y urgente porfavor.
Scripting
SuperDraco 3 4,776 Último mensaje 10 Diciembre 2009, 02:23 am
por SuperDraco
Necesito ayuda urgente porfavor
Programación C/C++
maticrack 3 2,231 Último mensaje 25 Noviembre 2012, 17:49 pm
por maticrack
PORFAVOR NECESITO AYUDA URGENTE !!! CON ENRUTAMIENTO ESTATICO PACKET TRACER
Redes
zad159 3 3,804 Último mensaje 7 Diciembre 2012, 02:00 am
por dato000
Porfavor necesito ayuda correos amenazantes.
Dudas Generales
SilverDemon 1 2,087 Último mensaje 11 Enero 2013, 01:19 am
por simorg
SOCKETS AYUDA URGENTE PORFAVOR!!!!
Java
Pitagoras 4 3,068 Último mensaje 9 Mayo 2022, 12:10 pm
por Pitagoras
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines