#include <iostream> #include <fstream> #include <iomanip> using namespace std; int main() { ifstream fichierIN("res.txt"); ofstream fichierOUT("salaire.txt"); string nom; int th, nbheure; double salaire; for (int i = 1; i <= 3; i++) { fichierIN >> nom >> th >> nbheure; if (nbheure > 40) { salaire = (40 * th) + ((nbheure - 40) * 1.5 * th); } else { salaire = nbheure * th; } fichierOUT << " " << setw(10) << left << nom << salaire << endl; } return 0; }