Problem 3nplus1II
User wongethan8192
Submission Time 2023-03-03 15:29:12
Score 0
Max Time N/A
Max Memory N/A

Compile Error

3nplus1II.cpp: In function ‘int main()’:
3nplus1II.cpp:3:12: error: ‘vector’ was not declared in this scope
3 | int main(){vector<int>b;int a,c;cin>>a>>c;b.push_back(a);while(a!=1){if(a%2)a=3*a+1;else a/=2;b.push_back(a);}
| ^~~~~~
3nplus1II.cpp:2:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
1 | #include<iostream>
+++ |+#include <vector>
2 | using namespace std;
3nplus1II.cpp:3:19: error: expected primary-expression before ‘int’
3 | int main(){vector<int>b;int a,c;cin>>a>>c;b.push_back(a);while(a!=1){if(a%2)a=3*a+1;else a/=2;b.push_back(a);}
| ^~~
3nplus1II.cpp:3:43: error: ‘b’ was not declared in this scope
3 | int main(){vector<int>b;int a,c;cin>>a>>c;b.push_back(a);while(a!=1){if(a%2)a=3*a+1;else a/=2;b.push_back(a);}
|