看板 NTUBIME101HW 關於我們 聯絡資訊
#include <iostream> #include <fstream> using namespace std; int main() { ifstream inFile("x1.dat"); ofstream outFile("x2.dat"); int s=inFile.get(); int i=0; while(!inFile.eof()) { if(s>48 && s<58) { s=s-48; if(s>6) outFile<<"9 "; if(s<4) outFile<<"1 "; i++; if(i%8==0) outFile<<endl; } s=inFile.get(); } inFile.close(); outFile.close(); system("pause"); return 0; } ------------------------------------- @ @" = ='' -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.241.88 ※ 編輯: vincent79715 來自: 140.112.241.88 (01/15 18:55)