Problem f7
User nishith13shah
Submission Time 2026-01-23 08:57:25
Score 0
Max Time N/A
Max Memory N/A

Compile Error

f7.cpp: In function ‘int main()’:
f7.cpp:9:9: error: ‘cin’ was not declared in this scope
9 | int n; cin >> n;
| ^~~
f7.cpp:3:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
2 | #include <algorithm>
+++ |+#include <iostream>
3 | using namespace std;
f7.cpp:19:2: error: ‘cout’ was not declared in this scope
19 | cout << ans;
| ^~~~
f7.cpp:19:2: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?