Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- string empleado; int categoria, categoria_ant;
- ifstream input ("empleados.txt");
- input >> empleado >> categoria;
- while (not input.eof())
- {
- categoria_ant = categoria;
- cout << categoria_ant << endl;
- while (not input.eof() and categoria_ant == categoria)
- {
- cout << '\t' << empleado << endl;
- input >> empleado >> categoria;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement