Problem exam
User ILoveCP
Submission Time 2025-04-08 14:30:49
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam.cpp: In function ‘int main()’:
exam.cpp:7:2: error: ‘cin’ was not declared in this scope
7 | cin >> x;
| ^~~
exam.cpp:2:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
1 | #include<stdio.h>
+++ |+#include <iostream>
2 | using namespace std;
exam.cpp:9:3: error: ‘cout’ was not declared in this scope
9 | cout << "Hello World" << endl;
| ^~~~
exam.cpp:9:3: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
exam.cpp:9:28: error: ‘endl’ was not declared in this scope
9 | cout << "Hello World" << endl;
| ^~~~
exam.cpp:2:1: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
1 | #include<stdio.h>
+++ |+#include <ostream>
2 | using nam