fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4.  
  5. struct Employee {
  6. string id, name;
  7. double hs, lcb, pc;
  8. };
  9.  
  10.  
  11. int main () {
  12. cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false);
  13.  
  14. fstream file("DATA.txt");
  15.  
  16. Employee a[10];
  17. for (int i=0; i<10; i++) {
  18. getline(cin, a[i].id);
  19. getline(cin, a[i].name);
  20. cin >> a[i].hs;
  21. cin >> a[i].lcb;
  22. cin >> a[i].pc;
  23. cin.ignore();
  24. }
  25.  
  26. for (int i=0; i<10; i++) {
  27. file << a[i].id << endl << a[i].name << endl << a[i].hs << endl << a[i].lcb << endl << a[i].pc << endl << a[i].hs*a[i].lcb+a[i].pc << endl;
  28. cout << a[i].hs*a[i].lcb+a[i].pc;
  29. }
  30.  
  31. file.close();
  32.  
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
1.38524e-309
0
0
0
0
0
1.13565e-310
1.13565e-310
1.13565e-310
9.88131e-324