cout << boolalpha << y<<endl;
#include<iostream>
#include<stdlib.h>
using namespace std;
int main(void)
{
?int x = 0;
?cout <<"請(qǐng)輸入一個(gè)整數(shù):"<<endl;
?cin >>x;
?cout <<oct << x <<endl;
?cout << dec <<x <<endl;
?cout << hex <<x <<endl;
?
?cout <<"請(qǐng)輸入一個(gè)布爾值(0,1):"<< endl;
?bool y = false;
?cin >> y;
?cout <<? y<<endl;?????
system("pause");
?return 0;
}?
問(wèn)題:我沒有輸入boolalpha結(jié)果也是一樣的??
2018-04-23
結(jié)果一樣,但是意義不一樣,沒有輸入boolalpha出來(lái)的值就不是布爾值