Lista1

  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Lista1 as PDF for free.

More details

  • Words: 185
  • Pages: 2
Lista 1 #include<stdio.h> #include #include #include<string.h> const TCAD=50; const NCAD=1310; int cadcomp(char *a, char*b) { while(*a==*b && *a) { a++; b++; } return(*a-*b); } void swap2(char d[][TCAD],int a,int b) { char aux[TCAD]; strcpy(aux,d[a]); strcpy(d[a],d[b]); strcpy(d[b],aux); } void quick2(char d[][TCAD],int izq, int der) { int i=0,ult=0,a=0; if(izq>=der)return; swap2(d,izq,(izq+der)/2); for(i=izq+1,ult=izq;i<=der;i++) if(strcmp(d[i],d[izq])
void main(void) { char d[NCAD][TCAD]; int izq,der,n=0,i=0; FILE *ent,*sal; /* clrscr(); printf("\t\t=Ordenador de listas=\n\n"); printf("Introduce la cantidad de nombres que se van a enlistar:"); scanf("%d",&c);

fflush(stdin); for(i=0;i>n; ent=fopen("C:\\Datos.txt","r"); if(ent==NULL) { cout<<"No se puede abrir el archivo de entrada"; getch(); return; } sal=fopen("C:\\Datos2.txt","w"); if(sal==NULL) { cout<<"No se puede abrir el archivo de salida"; getch(); return; } i=0; while(i
}

Related Documents

Lista1
July 2020 7
Lista1
July 2020 5
Lista1-calculo1
June 2020 5
Workshop Lista1
October 2019 8
Lista1.docx
April 2020 3