mfccon.cpp
上传用户:z_mail1980
上传日期:2007-06-01
资源大小:647k
文件大小:1k
- //Build: cl /MT mfccon.cpp
- #include <afx.h>
- #include <stdio.h>
- int main()
- {
- int lo,hi;
- CString str;
- CStdioFile fFibo;
- fFibo.Open("FIBO.DAT",CFile::modeWrite|CFile::modeCreate|CFile::typeText);
- str.Format("%sn","Fibonacci sequencee,less than 100:");
- printf("%s",(LPCTSTR)str);
- fFibo.WriteString(str);
- lo=hi=1;
- str.Format("%dn",lo);
- printf("%s",(LPCTSTR)str);
- fFibo.WriteString(str);
- while(hi<100)
- {
- str.Format("%dn",hi);
- printf("%s",(LPCTSTR)str);
- fFibo.WriteString(str);
- hi=lo+hi;
- lo=hi-lo;
- }
- fFibo.Close();
- return 0;
- }