C语言哪个不是常用浮动窗口,C语言高手进来解释下……数据类型和运行窗口有什么关系...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

printf("the aver of bonus is %d\n", aver_b );

/*  按基本工资和奖金的多少输出各段的个数*/

for (i=0;i

{

if (w[i].wage>3001 ) a+=1;

if (w[i].wage<3000&&w[i].wage>2001) b+=1;

if (w[i].wage<2000&&w[i].wage>1501) c+=1;

if (w[i].wage<1500&&w[i].wage>1001) d+=1;

if (w[i].wage<1000) e+=1;

if (w[i].bonus>301 ) f+=1;

if (w[i].bonus<300&&w[i].bonus>201 ) g+=1;

if (w[i].bonus<200&&w[i].bonus>151 ) h+=1;

if (w[i].bonus<150&&w[i].bonus>100 ) j+=1;

if (w[i].bonus<100) k+=1;

}

printf("The number of presons that whose wage >3001 is %d\n",a );

printf("The number of presons that whose wage <3000 || >2001 is %d\n",b);

printf("The number of presons that whose wage <2000 || 1501> is %d\n",c);

printf("The number of presons that whose wage <1500 || 1001> is %d\n",d);

printf("The number of presons that whose wage <1000  is %d\n",e);

printf("The number of presons that whose bonus>301 is %d\n",f );

printf("The number of presons that whose bonus<300 || >201 is %d\n",g );

printf("The number of presons that whose bonus<200 || >151 is %d\n",h );

printf("The number of presons that whose bonus<150 || >101 is %d\n",j);

printf("The number of presons that whose bonus<100 is %d\n",k);

/*  输出工资低于1000或奖金低于100的职工姓名*/

for (i=0;i<10;i++)

{

if(w[i].wage<1000&&w[i].bonus<100)

printf("%d%c",w[i].num,w[i].name);

}

getch();

}

这样运行没问题,但由于我想把结构体中num的数据类型由int型改为float型,于是在那三段代码对应的这三个地方分别

把第7行的“long int”改为“float”;

把第21行的第一个“ld”改为“f”;

把第51行的“ld”改为“f”。

然后问题就出来了:点击“编译链接并运行”按键后,窗口跳出一下后立刻消失!真不明白“数据类型”跟“运行窗口”有什么关系!

其实并不单单在这个程序里,我发现在很多很小的程序里也是这个情况,只要把“long int”改为“float”;把“d”改为“f”,结果就是:窗口弹出立马消失。

C语言高手进来解释下……

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值