注册 登录
编程论坛 C++教室

c++应用程序自动关闭

a33445321 发布于 2012-03-09 20:59, 730 次点击
代码
#include <iostream>
using namespace std;
int main()
{
    int A,B,D;                   //D为等效电阻
    cout<<"请输入两个电阻:";   
    cin>>A>>B;
    D=A*B/(A+B);   
    cout<<"等效电阻为:"<<D<<endl;
    return 0;
}

编译成的程序。。输入AB。。后就立刻自动关闭了。未出现please enter any key to ...
7 回复
#2
非死亡!2012-03-10 23:30
没有错的  我的是好的 你的机子的问题 下了哈
#3
a334453212012-03-11 13:30
回复 2楼 非死亡!
机子。。问题??貌似吧。。。我换下机子试试看
#4
a334453212012-03-11 13:32
回复 2楼 非死亡!
问个问题,呵呵。。那个命名空间using namespace std;    里面的std..换其他的可以吗??
#5
非死亡!2012-03-11 16:28
这没有什么必要吧  std(Standard)的缩写.为什么要换呢?
#6
a334453212012-03-11 22:57
哦哦、、要是换成其他的字符可以吗??
#7
yuccn2012-03-12 09:48
可能与配置什么有关吧
加个 system("pause");或者getchar();在最后一行就ok了
#8
零波丽2012-03-12 12:04
编译器问题
1