VS210 问题解决


若此时进行的操作是编译(F5),可先运行程序(Ctrl+F5),若仍然一闪而过,用下面方法解决。

解决方法如下:


方法一:
1.若是C++文件,在程序最后写一句(return之前)添加:system("pause");
2.若是C文件,首先在程序头添加头文件:#include"stdlib.h";然后在程序最后写一句(return之前)添加:system("pause")。
方法二:
1.右键单击当前工程-属性 
2.选择配置属性-链接器-系统 
3.更改系统选项中的“子系统”配置,选择下拉菜单的第一个“控制台 (/SUBSYSTEM:CONSOLE)”
然后选择"开始执行(不调试)",也就是ctrl+F5;


#include "stdio.h"
#include "string.h"
#include "stdlib.h" /  为了解决在 CMD 命令中  屏幕显示就退出:system("pause");


#define DENSITY 62.4 ///人的密度


int main()
{
  float weight, volume;
  int size, letters;
  char name[40]; name 是一个有40个字符的数组


  printf("Hi! What's your first name?\n");
  scanf("%s" ,name);
  size = sizeof name;
   printf("Hi! What's your weight in pounds?\n");
  scanf("%f" ,&weight);
  letters= strlen(name);
  volume=weight/DENSITY;
  printf("Well, %s your volume is %2.2f cubic feet.t\n", name, volume);
  printf("Also, your fisrt name has %d letterss,\n", letters);
  printf("and,  we have %d  btyes to stroe it in.\n", name,size);
   system("pause");
  return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值