直接复制你的程序编译 没发现问题
运行结果
press return after entering a number.
enter the number of pods:
3
enter the number of peas in a pod:
4
if you have3and4peas in each pod,then
you have12peas in all the pods.
你把错误信息发上来看下
头文件前面加上#include"stdafx.h"
如这样,我这里行了。
#include"stdafx.h"
#include
using namespace std;
int main()
{
int number_of_pods,peas_per_pod,total_peas;
cout << "press return after entering a number.\n";
cout << "enter the number of pods:\n";
cin >> number_of_pods;
cout << "enter the number of peas in a pod:\n";
cin >> peas_per_pod;
total_peas=number_of_pods*peas_per_pod;
cout << "if you have";
cout << number_of_pods;
cout << "and";
cout << peas_per_pod;
cout << "peas in each pod,then\n";
cout << "you have";
cout << total_peas;
cout << "peas in all the pods.\n";
return 0;
}
把错误提示贴出来啊
我编译了一下,木有问题,你用的什么编译器?
你把提示信息也发上来