-
Notifications
You must be signed in to change notification settings - Fork 0
/
manipulate_sign.cpp
35 lines (32 loc) · 994 Bytes
/
manipulate_sign.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Created by SheJie on 2019-05-03.
//
#include "include/manipulate_sign.h"
#include <iostream>
#include <iomanip>
using namespace std;
void echo() {
cout << "---操作符函数格式化输入输出---" << endl;
const double PI = 3.141592;
cout << PI << endl
<< setprecision(0) << PI << endl
<< setprecision(1) << PI << endl
<< setprecision(2) << PI << endl
<< setprecision(3) << PI << endl
<< setprecision(7) << PI << endl;
int number = 100;
cout << "DES:" << dec << number << endl
<< "HEX:" << hex << number << endl
<< "OCT:" << oct << number << endl;
cout << number << endl
<< 100 << endl
<< "Input number = ";
cin >> number;
cout << number << endl;
cout << dec << setiosflags(ios_base::showpos) << number << endl
<< "Input number = ";
cin >> number;
cout << number << endl;
cout << resetiosflags(ios_base::showpos);
cout << number << endl;
}