fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cin >> n;
  9. double *x = new double[n];
  10. for (int i = 0; i < n; i++) {
  11. cin >> x[i];
  12. }
  13. bool checker = 0;
  14. for (int i = 0; i < n; i++) {
  15. if (x[i] <= 2.5 && checker == false) {
  16. cout << i + 1 << ' ' << fixed << setprecision(2) << x[i];
  17. checker = true;
  18. }
  19. }
  20. if (checker == false)
  21. cout << "Not Found";
  22. delete []x;
  23. return 0;
  24. }
Success #stdin #stdout 0s 4520KB
stdin
5
6 7.5 2.1 2.0 0
stdout
3 2.10