KULLANICI ADI : ŞİFRE Şifremi Unuttum*

Anasayfa İLLEG4L BANK KREDİ SATIN AL İLLEG4LİZM RAP Sub Domain Bulucu Arama Yap Yeni Konular Bugünki Konular

Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
*.txt Dosyasina kayit yapmak!
Konu : *.txt Dosyasina kayit yapmak! - 28.08.2015, 21:20
Mesaj: #1
skor.txt dosyasina maç tarihi skorunu golleri kayit yapan yenileyen silen sorgulama yapabilen bir program!


 

Kod:
[align=center][font=Tahoma, Verdana, Arial, Helvetica]#include   <iostream.h>[/font][/align]
[align=center][font=Tahoma, Verdana, Arial, Helvetica]#include   <conio.h>[/font][/align]
[align=center][font=Tahoma, Verdana, Arial, Helvetica]#include   <fstream.h>[/font][/align]
[align=center][font=Tahoma, Verdana, Arial, Helvetica]#include <iomanip.h>[/font][/align]
[align=center][/align]
[align=center][/align]
[align=center]int gun,ay,yil,biz,onlar,kontrol=0;[/align]
[align=center]char saha;[/align]
[align=center][/align]
[align=center]void kayit()[/align]
[align=center]{[/align]
[align=center]int kayitSayisi,i;[/align]
[align=center]cout<<"dosyaya kac kayit yapilacak ?"<<endl;[/align]
[align=center] cin>>kayitSayisi;[/align]
[align=center]ofstream futbol;[/align]
[align=center]futbol.open("skor.txt",ios::out);[/align]
[align=center]for(i=0;i<kayitSayisi; i++)[/align]
[align=center]{[/align]
[align=center]cout<< " verileri giriniz ?"<<endl;[/align]
[align=center]cin>>gun>>ay>>yil>>saha>>biz>>onlar;[/align]
[align=center]futbol << gun<<setw(3)<<setw(3)<<ay<<setw(3)<<yil<<setw(3)<<saha<<setw(3)<<biz<<setw(3)[/align]
[align=center]       <<onlar<<setw(3)<<endl;[/align]
[align=center]}[/align]
[align=center]futbol.close();[/align]
[align=center]getch();[/align]
[align=center]}[/align]
[align=center][/align]
[align=center][/align]
[align=center][/align]
[align=center]void kayitIlave()[/align]
[align=center]{[/align]
[align=center]int ilaveKayit,i;[/align]
[align=center]cout<<"dosyaya kac kayit ilave edilecek ?"<<endl;[/align]
[align=center] cin>>ilaveKayit;[/align]
[align=center]ofstream futbol;[/align]
[align=center]futbol.open("skor.txt",ios::app);[/align]
[align=center]for(i=0;i<ilaveKayit; i++)[/align]
[align=center]{[/align]
[align=center]cout<< " verileri giriniz ?"<<endl;[/align]
[align=center]cin>>gun>>ay>>yil>>saha>>biz>>onlar;[/align]
[align=center]futbol << gun<<ay<<yil<<saha<<biz<<onlar<<endl;[/align]
[align=center]}[/align]
[align=center]futbol.close();[/align]
[align=center]getch();[/align]
[align=center]}[/align]
[align=center][/align]
[align=center]void liste()[/align]
[align=center]{[/align]
[align=center]clrscr();[/align]
[align=center]ifstream futbol;[/align]
[align=center]futbol.open("skor.txt",ios::in);[/align]
[align=center]while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar)[/align]
[align=center]{[/align]
[align=center]cout<< gun<<ay<<yil<<saha<<biz<<onlar<<endl;[/align]
[align=center]cout<endl;[/align]
[align=center] }[/align]
[align=center]futbol.close();[/align]
[align=center]getch();[/align]
[align=center]}[/align]
[align=center][/align]
[align=center]void silme()[/align]
[align=center]{[/align]
[align=center]int silinecekYil;[/align]
[align=center]clrscr();[/align]
[align=center]cout<<"silinecek yil giriniz "<<endl;[/align]
[align=center] cin>>silinecekYil;[/align]
[align=center]ifstream futbol;[/align]
[align=center]futbol.open("skor.txt",ios::in);[/align]
[align=center]ofstream gecici;[/align]
[align=center]gecici.open("gecici.txt",ios::out);[/align]
[align=center]while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar)[/align]
[align=center]{[/align]
[align=center]if(silinecekYil!=yil)[/align]
[align=center]{[/align]
[align=center] gecici << gun<<ay<<yil<<saha<<biz<<onlar<<endl;[/align]
[align=center] }[/align]
[align=center] }[/align]
[align=center][/align]
[align=center][/align]
[align=center]futbol.close();[/align]
[align=center]gecici.close();[/align]
[align=center][/align]
[align=center]  // copy temp to milan[/align]
[align=center]  ifstream f1("gecici.txt");[/align]
[align=center]  ofstream f2("skor.txt");[/align]
[align=center]  f2<<f1.rdbuf();[/align]
[align=center][/align]
[align=center]} [/align]
[align=center][/align]
[align=center][/align]
[align=center]void sorgu()[/align]
[align=center]{int yilAra; [/align]
[align=center]cout<<"hangi yila ait kayitlari araniyor ?"<<endl;[/align]
[align=center] cin>>yilAra;[/align]
[align=center]ifstream futbol; [/align]
[align=center]futbol.open("skor.txt",ios::in);[/align]
[align=center]while(futbol>>gun>>ay>>yil>>saha>>biz>>onlar ) [/align]
[align=center]{ [/align]
[align=center]if(yilAra==yil) [/align]
[align=center]cout<<   gun<<ay<<yil<<saha<<biz<<onlar<<endl;[/align]
[align=center]}[/align]
[align=center]futbol.close(); [/align]
[align=center]getch(); [/align]
[align=center]} [/align]
[align=center][/align]
[align=center][/align]
[align=center]void menu() [/align]
[align=center]{ [/align]
[align=center]int secim; [/align]
[align=center]clrscr(); [/align]
[align=center]while(kontrol==0) [/align]
[align=center]{ [/align]
[align=center]cout<<"[1] - Kayit " <<endl;[/align]
[align=center] cout<<"[2] - Kayit Ilave " <<endl;[/align]
[align=center]  cout<<"[3] - Silme " <<endl;[/align]
[align=center]   cout<<"[4] - Liste " <<endl;[/align]
[align=center]    cout<<"[5] - sorgu " <<endl;[/align]
[align=center]     cout<<"[6] - Cikis " <<endl;[/align]
[align=center]      cout<<"Seciminiz:"<<endl;[/align]
[align=center]       cin>>secim; [/align]
[align=center]if(secim==1) kayit(); [/align]
[align=center]if(secim==2) kayitIlave(); [/align]
[align=center]if(secim==3) silme(); [/align]
[align=center]if(secim==4) liste(); [/align]
[align=center]if(secim==5) sorgu(); [/align]
[align=center]if(secim==6) kontrol=1; [/align]
[align=center]else menu(); [/align]
[align=center]} [/align]
[align=center]} [/align]
[align=center]void main() [/align]
[align=center]{ [/align]
[align=center]menu(); [/align]
[align=center]} [/align]
#Return Time
#XSYZZR

WWW Alıntı ile Cevapla


Hızlı Menü:


Konuyu Okuyanlar: 1 Ziyaretçi
hd porno antalya escort türk ifşa porno izle türk ifşa porno samsun escort izmir escort ataşehir escort türk ifşa hd porno