Şimdi Ara

pascal istediğiniz aralıktaki asal sayıları bulup dosyaya yazdıran program(sorun var)

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
4
Cevap
0
Favori
728
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • program Untitled; 
    uses crt;
    label son;
    var
    dosya:file of integer;nasil:string;
    sayi,a,aralik:integer;
    begin
    writeln('Kaca kadar olan asla sayilar bulunsun?');readln(aralik);
    writeln('nereye kaydedilsin');readln(nasil);
    sayi:=1;
    assign(dosya,nasil);
    rewrite(dosya);
    repeat
    sayi:=sayi+1;
    for a:=2 to sayi-1 do
    begin
    if sayi mod a=0 then goto son;
    seek(dosya,filesize(dosya));write(dosya,sayi);
    end;
    son:
    until sayi=aralik;
    readln;
    end.

    arkadaşlar istediğim dosyayı açıyor kaydetme olmasa sayılarıda buluyor ama dosyaya yazdığında şöyle garip birşeyler yazıyor
                               	                               










                                                                                                                       ! # # # % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ' ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 1 1 1 1 1 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 7 7 7 9 ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ? A A A C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C E G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I K M M M M M O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O Q S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S U U U W Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y [ [ [ [ [ ] _ _ _ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a c







  • pascal için çok net hatırlamıyorum ama binary dosya yerine text bir dosyaya yazdırsan sorunun çözülür sanırım. Binary dosya tipinde kayıt yapacaksan record tanımlamak zorundasın gibi hatırlıyorum. Genede dosyanın içine bakınca anlamsız karakterler görürsün. Sadece kaydettiğin dosyadan kaydettiğin record tipini okuyup ekrana yazdırırsan doğru görünür.



    < Bu mesaj bu kişi tarafından değiştirildi damlaltd -- 12 Haziran 2008; 22:24:52 >
  • VAR F: TEXT ;

    assign(F,'MyInput.txt') ;
    reset(F);
    read(F,N) ;
    WriteLn('The number was',N)


    yada

    VAR F: TEXT ;

    assign(F,'MyOutput.txt') ;
    rewrite(F);

    WriteLn(F,'10 A KADAR SAYILARIN KARESİ:-') ;
    FOR i=1 TO 10 DO WriteLn(F,i,i*i) ;

    TXT dosyayı açıp bakıncada doğru görünecektir.
  • program Untitled; 
    uses crt;
    label son;
    var
    dosya:text;
    sayi,a,aralik:integer;
    begin
    writeln('Kaca kadar olan asla sayilar bulunsun?');readln(aralik);
    sayi:=1;
    assign(dosya,'dosyam.txt');
    rewrite(dosya);
    repeat
    sayi:=sayi+1;
    for a:=2 to sayi-1 do
    begin
    if sayi mod a=0 then goto son;
    write(dosya,sayi);
    end;
    writeln(sayi);
    son:
    until sayi=aralik;
    readln;
    end.

    böyle yaptım öncekinde en azından saçma da olsa bişeyler yazıyodu şimdi hiç bi şey yazmıyo
    edit:imla



    < Bu mesaj bu kişi tarafından değiştirildi oguzhanlal -- 13 Haziran 2008; 22:52:31 >
  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.