Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. program notass(input,output);
  2. uses crt, sysutils;
  3. type notas = record
  4. nombre:string;
  5. nota:integer;
  6. end;
  7. var
  8. fnotas: file of notas;
  9. rnotas:notas;
  10.  
  11. begin
  12. assign(fnotas,'C:\Users\Gaston\Desktop/notas.dat');
  13. if not(fileexists('C:\Users\Gaston\Desktop/notas.dat'))then begin
  14. rewrite(fnotas);
  15. end;
  16. reset(fnotas);
  17. writeln('nombre y nota');
  18. readln(rnotas.nombre);
  19. readln(rnotas.nota);
  20.  
  21. write(fnotas,rnotas);
  22. reset(fnotas);
  23. read(fnotas,rnotas);
  24. write(rnotas.nombre,' ', rnotas.nota);
  25.  
  26. reset(fnotas);
  27. while(not eof(fnotas)) do begin
  28.  
  29. write(fnotas,rnotas);
  30. end;
  31. readln();
  32. close(fnotas);
  33. end.
  34. //'C:\Users\Gaston\Desktop/notas.dat'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement