---
title: "上机总结"
author: "Jason5563"
date: "2010-08-02T16:36:37Z"
tags: ["C", "C#", "C++", "iOS"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-08-03T18:02:26Z"
id: 727272
url: "https://jason5563.iteye.com/blog/727272"
---

不少学校的上机都是C++，得重操旧业了。

 

1、string 字符串，

#include&lt;iostream&gt;  
#include&lt;string&gt;  
using namespace std;

 

输入输出：

cin,cout

 

相等比较，直接==

 

2、文件操作

freopen("in.txt", "r", stdin);  
freopen("out.txt", "w", stdout);

如果是绝对地址，则\\\\

 

3、小数精度控制

 cout.setf(ios::fixed);  
 cout.precision(2);