把编译后的exe文件直接传给别人,运行不成啊
时间:2011-12-12
来源:互联网
我把这台机器上的a.cpp编译运行之后,把a.exe给别人, + h/ ^( m: W: \0 [: r+ K
结果别人运行a.exe之后显示的是上次我给他发的b.exe的那套代码。(貌似是, 反正就是出入很大)$ M z% v0 G! G
7 k P6 B2 D# {! i' l这个是什么问题? 然后别人在自己机器上把a.cpp文件编译运行之后又好了。/ J7 p6 c4 q+ E! [( s
. a0 b+ s) y6 s3 ~3 e# B6 \0 c0 s, ?
还有就是这个代码, 在我机器上没有问题, 可在别人机器上编译运行之后相加结果是e12 45435 什么什么的。
结果别人运行a.exe之后显示的是上次我给他发的b.exe的那套代码。(貌似是, 反正就是出入很大)$ M z% v0 G! G
7 k P6 B2 D# {! i' l这个是什么问题? 然后别人在自己机器上把a.cpp文件编译运行之后又好了。/ J7 p6 c4 q+ E! [( s
. a0 b+ s) y6 s3 ~3 e# B6 \0 c0 s, ?
还有就是这个代码, 在我机器上没有问题, 可在别人机器上编译运行之后相加结果是e12 45435 什么什么的。
复制内容到剪贴板
using namespace std;
int main ()
{
int i;
double b;
double a[100]={};
cout<<"How many number would you like to calculate?"<<endl;
cin>>i;
for(int n=0;n<i;n++)
{cout<<"Enter number "<<(n+1)<<endl;
cin>>a[n];
}
cout<<"The number you entered is: "<<endl;
for(int n=0;n<i;n++)
{cout<<a[n]<<", ";
}
cout<<"The result is: ";
cout<<a[i-1]+a[i-2]+a[i-3]+a[i-4]+a[i-5]+a[i-6]+a[i-7]+a[i-8]+a[i-9]+a[i-10]+a[i-11]+a[i-12]+a[i-13];
cout<<endl<<endl;
system("pause");
}
代码:
#include<iostream>using namespace std;
int main ()
{
int i;
double b;
double a[100]={};
cout<<"How many number would you like to calculate?"<<endl;
cin>>i;
for(int n=0;n<i;n++)
{cout<<"Enter number "<<(n+1)<<endl;
cin>>a[n];
}
cout<<"The number you entered is: "<<endl;
for(int n=0;n<i;n++)
{cout<<a[n]<<", ";
}
cout<<"The result is: ";
cout<<a[i-1]+a[i-2]+a[i-3]+a[i-4]+a[i-5]+a[i-6]+a[i-7]+a[i-8]+a[i-9]+a[i-10]+a[i-11]+a[i-12]+a[i-13];
cout<<endl<<endl;
system("pause");
}
作者: alleni 发布时间: 2011-12-12
对于你这个程序你应该提示计算的数目要大于等于13
7 f/ n P, t8 I6 e; Q5 P6 k4 o" i& c5 q不然结果肯定是错误的
7 f/ n P, t8 I6 e; Q5 P6 k4 o" i& c5 q不然结果肯定是错误的
作者: 月夜幻影 发布时间: 2011-12-12
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28