第一次在計算機科學課上。第一個實驗任務。完全寫出了老師寫的東西,但它不會編譯,老師或我都不知道爲什麼。請幫忙。謝謝。錯誤:在';'令牌之前預期的初級表達式
#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;
}
錯誤:
lab01.cpp:在函數 '詮釋主()':
lab01.cpp:11:錯誤:預期; 'ENDL'
之前 '' lab01.cpp:12:錯誤:預期 ';' 'ENDL' 之前
lab01.cpp:14:錯誤:預期; 'ENDL'
之前 ''lab01.cpp:19:錯誤:預期 ';' 'ENDL' 之前
lab01.cpp:21:錯誤:預期前主表達式 ';' 令牌
失蹤 「<<」 之前 「ENDL」。 –
如果你的老師在這裏找不到問題,我會很擔心。 –
是的,我們的老師是數學老師,我認爲這是他第一次教csci。 – user3233139