1 개요[ | ]
- C++ round()
C++
Copy
#include <iostream>
#include <cmath>
using namespace std;
int main() {
cout << round(3.14159) << endl; // 3
}
Loading
C++
Copy
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
cout << setprecision(3) << 3.14159 << endl; // 3.14
cout << setprecision(5) << 123.56789 << endl; // 123.57
}
Loading
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.