TXT文件是这样的
1 ¥20
2 ¥30
3 ¥40
我也不想保存¥字符 有什么办法吗
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
int main(){
int i;
float cost;
ifstream file("doc.txt");
while (file>>i){
file>>cost;
}
file.close();
return 0;
}