You are on page 1of 1

m s t trong file text c++

anh ch gip em bi m s t trong file text vi,em lm th ny n in ra mn hnh xu m khng c du cch??,v khng dm c s t,sao vy nh. anh ch no c ti liu g v file text th cho em vi,thank nhiu:
PHP Code:

#include<iostream.h> #include<conio.h> #include<fstream.h> void main() { int i=0; clrscr(); char c; ifstream f("F:\\XAU.TXT", ios::in); if(f.bad()) cout<<"\n khong the mo tep,co the do tep khong ton tai"; else do { f>>c; cout<<c; if(c==' ')i++; }while((c!='\0')&&(f)); f.close(); cout<<endl<<"so tu la:"<<i; return; }

You might also like