高手能不来吗?!
为什么差不多的源程序,但在C和C++中生成的EXE文件大小差那么多呢?
C的源程序:#include<string.h>
main()
{
char str[4];
float a=5.0,b=0.9,c,d;
printf("你是人吗?");
printf("\n");
gets(str);
if(strcmp(str,"yes")==0)
{
printf("猪,做个题目吧");
c=a/b;
printf("a=5,b=0.9 a/b是多少啊?\n");
scanf("%f",&d);
if(d==c)
printf("J2MV9-JYYQ6-JM44K-QMYTH-8RB2W");
else printf("笨蛋,算都算不对,滚!");
}
else printf("你不是啊,滚吧!");
}
C++的源程序
#include<iostream.h>
#include<string.h>
void main(void)
{ char a[4],aa[90];
cout<<"你是人吗?\n";
cin.getline(a,4);
if(strcmp(a,"yes")==0)
{
cout<<"猪,做个题目吧!不然的话,小心病毒";
float a,b=0.9,c,d;
a=5.0;
c=a/b;
cout<<"a=5,b=0.9 a/b是多少啊?\n";
cin>>d;
if(d==c)
cout<<"聪明!算你运气,不给你放病毒了。\n";
else cout<<"笨蛋,你有没有学过数学啊>滚!\n";
}
else cout<<"你不是啊,滚吧!\n";
cout<<"enter your English name to exit\n";
cin>>aa;