错误:在';'之前预期的primary-expression 代币

-2 c++ cloud9-ide

第一次参加计算机科学课.首次实验室任务.写下老师所写的内容,但它不会编译,老师和我都无法弄明白为什么.请帮忙.谢谢.

#include <iostream>
#include <string>

using namespace std;

int main ()
{
int number;
string residence;
//Just an example of a comment
cout << "Hello. Welcome to CSCI-1!" endl;
cout << "Spring 2014" endl;

cout << "please enter a number: " endl;
cin >> number;

cout << "you entered the number: " << number <<endl;

cout<<"Please enter your state of residence: " endl;
cin>>residence;
cout <<"you stated you live in " << residence <<"." <<;
return 0;
}
Run Code Online (Sandbox Code Playgroud)

错误:

lab01.cpp:在函数'int main()'中:

lab01.cpp:11:错误:预期';' 在'endl'之前

lab01.cpp:12:错误:预期';' 在'endl'之前

lab01.cpp:14:错误:预期';' 在'endl'之前

lab01.cpp:19:错误:预期';' 在'endl'之前

lab01.cpp:21:错误:在';'之前预期的primary-expression 代币

Jar*_*Par 5

<<endl构造之前缺少运算符.更改

cout << "Hello. Welcome to CSCI-1!" endl;
Run Code Online (Sandbox Code Playgroud)

cout << "Hello. Welcome to CSCI-1!" << endl;
Run Code Online (Sandbox Code Playgroud)