Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. main(){
  5. char cedula[15],indice[5],veccedula[20],u;
  6. int i,cant,k,a,b,cont;
  7. printf("Ingrese Cantidad de personas: ");scanf("%i",&cant);
  8. cont=0;
  9. for(i=0;i<cant;i++){
  10. printf("Ingrese cedula#%i: ",i+1);scanf("%s",cedula);
  11. k=strlen(cedula);
  12. indice[1]=cedula[k-1]; //ultima posición
  13. indice[0]=cedula[k-2]; //penultima
  14. indice[2]=''; // fin de cadena
  15. a=atoi(indice);//Transformo el indice a entero
  16. if(a<=20){
  17. veccedula[a]=cedula;
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement