我用的是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()
std没加分号(";")