fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, count, result = 0;
  6. long double cost;
  7. cin >> n;
  8. for (int i = 0; i < n; i++) {
  9. cin >> count >> cost;
  10. if (cost < 50) {
  11. result += count;
  12. }
  13. }
  14. cout << result;
  15. return 0;
  16. }
Success #stdin #stdout 0s 15232KB
stdin
3
2 100.00
5 23.00
10 22.50

stdout
15