C++的程序问题! [Error] expected ';' before 'int'这是什么原因造成的?

我用的是Dev-C++,用的是源代码。这里付张图。

1 #include <iostream>
2 using namespace std
3 int main()
4 {
5 int number_of_pods,peas_per_pod,total_peas;
6c out<<"Press return after entering a number"<<endl;
7 cout<<"Enter the number of pods"<<endl;
8 cin>>number_of_pods;
9 cout<<"Enter the number of peas in a pod"<<endl;
10 cin>>peas_per_pod;
11 total_peas=number_of_pods*peas_per_pod;
12 cout<<"If you have";
13 cout<<number_of_pods;
14 cout<<"pea pods"<<endl;
15 cout<<"and";
16 cout<<peas_per_pod;
17 cout<<"peas in each pod,then"<<endl;
18 cout<<"you have";
19 cout<<total_peas;
20 cout<<"peas in all the pods"<<endl;
21 return 0;
22 }
这是代码内容。但为什么一直报错。关于第三行的int main()

Int前出现了不规范的字符或者是使用不当的关键字、字符等;建议排查下出现错误地方的语句是否使用正确;。
比如在类的继承中,虚基类,纯虚类的关键字遗漏、少用等都会出现这种错误。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-05-10
#include <iostream>
using namespace std;
int main()
{
    int number_of_pods,peas_per_pod,total_peas;
    cout<<"Press return after entering a number"<<endl;
    cout<<"Enter the number of pods"<<endl;
    cin>>number_of_pods;
    cout<<"Enter the number of peas in a pod"<<endl;
    cin>>peas_per_pod;
    total_peas=number_of_pods*peas_per_pod;
    cout<<"If you have";
    cout<<number_of_pods;
    cout<<"pea pods"<<endl;
    cout<<"and";
    cout<<peas_per_pod;
    cout<<"peas in each pod,then"<<endl;
    cout<<"you have";
    cout<<total_peas;
    cout<<"peas in all the pods"<<endl;
    return 0;
  }

std没加分号(";")

第2个回答  2013-05-10
std后面没加分号的缘故本回答被提问者采纳
第3个回答  2015-10-25
std后面没加分号的缘故
你在仔细检查一下