首页 新闻 会员 周边 捐助

Visual Studio C++里面问什么只能输出第一个cout而下面的完全不显示是什么原因呀

0
悬赏园豆:10 [待解决问题]

int main()
{
cout << "please enter a floating-point value:";
double n;
cin >> n;
cout << "n==" << n
<< "\nn+1==" << n + 1
<< "\nthree times n==" << 3 * n
<< "\ntwice n==" << n + n
<< "\nn squared==" << n * n
<< "\nhalf of n==" << n / 2
<< "\nsquare root of n==" << sqrt(n)
<< endl;
}

问题补充:

输出的结果就是这个
please enter a floating-point value:

在梦想的路上挣扎的主页 在梦想的路上挣扎 | 初学一级 | 园豆:192
提问于:2019-07-11 18:58
< >
分享
所有回答(1)
0

include "stdafx.h"

include "math.h"

include <iostream>

using namespace std;

void main()
{
cout << "please enter a floating-point value:";
double n;
cin >> n;
cout << "n==" << n
<< "\nn+1==" << n + 1
<< "\nthree times n==" << 3 * n
<< "\ntwice n==" << n + n
<< "\nn squared==" << n * n
<< "\nhalf of n==" << n / 2
<< "\nsquare root of n==" << sqrt(n)<< endl;
}

丨莫忘初心 | 园豆:202 (菜鸟二级) | 2019-07-11 20:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册