I have a file that contains, numbers(ints) and words both, I want to read only the integers, Please ignore the macros if they are annoying, However I only need to have the integers but I have to be sure to also read the strings and then disregard them What do I have to modify here:
#include <iostream>
#include <vector>
#include <cmath>
#include <fstream>
using namespace std;
int main(){
FastIO;
ifstream fin("input.txt",ios::in);
int minsal =10000000;
int num;
cout<<minsal;
fin.close();
ofstream fout("output.txt",ios::out);
fout.close();
return 0;
}
An example file could be :
Vineel Phatak, 520, Amkart, NOBODY
Ajay Joshi, 250, Amkart, Vineel Phatak
Abhishek Chauhan, 120, Amkart, Ajay Joshi
Jayesh Godse, 500, Airflix, NOBODY
Vijaya Mundada, 60, Amkart, Abhishek Chauhan
Shital Tuteja, 45, Airflix, Jayesh Godse
Rajan Gawli, 700, Amkart, Vineel Phatak
Sheila Rodrigues, 35, Amkart, Vineel Phatak
Zeba Khan, 300, Airflix, Jayesh Godse
Chaitali Sood, 100, Airflix, Zeba Khan