为了账号安全,请及时绑定邮箱和手机立即绑定

C++运行窗口闪退

C++运行窗口闪退

C++ C
ZOL慕雪瞳 2015-12-11 19:55:38
#include <stdio.h>  int main(){    int year=2015;    if ((year % 4 == 0 && year % 100) || (year % 400 == 0)) { printf("%s\n", "今年是闰年"); } else { printf("%s\n", "今年是平年"); } printf("Press any key to continue...\n");       return 0;}生成的时候没问题,调试的时候,窗口一闪就没了The program '[7312] Project3.exe' has exited with code 0 (0x0).这是vasual studio2015中的VC++,求大神告知
查看完整描述

3 回答

已采纳
?
流浪_老

TA贡献71条经验 获得超14个赞

#include <stdio.h>

#include<stdlib.h>

  int main()

{

   int year=2015;

   if ((year % 4 == 0 && year % 100) || (year % 400 == 0)) {

printf("%s\n", "今年是闰年");

}

else {

printf("%s\n", "今年是平年");

}

printf("Press any key to continue...\n");

system("pause");

      return 0;

}


查看完整回答
反对 回复 2015-12-11
?
深水曲静

TA贡献1条经验 获得超0个赞

#include<stdlib.h>

system("pause");

return 0;

查看完整回答
反对 回复 2015-12-11
  • 3 回答
  • 0 关注
  • 4010 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信