
函数,特殊语法
pfeiKing
安安静静地先稳住
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
scanf,cout
//scanf和cout的格式 //printf("%5d",a);右对齐五个宽度//printf("%05d",a);右对齐0填充 #include#include#include#includeusing namespace std;int n;double d;void Input(){ int t,mark; int sum; while(~scanf("%d"原创 2015-10-23 10:50:15 · 566 阅读 · 0 评论 -
C++杂七杂八
CLOCK &FunC(形参);返回值是CLOCK类的引用非类的成员函数,不用加const在末尾"#includeusing namespace std;class Complex{ public: Complex(double r=0.0,double i=0.0):real(r),imag(i){} friend Complex operator+(const原创 2018-01-15 10:32:28 · 315 阅读 · 0 评论 -
getline函数
对于cin遇到空格就要等到下一次才能输入了。因此需要使用getlinegetline(cin,str,',');//','是分隔符,即在输入过程中遇到','就会停止输入。例如getline(cin,str,' ');键入aaa bbb ccc而str中只存入了aaa键入aaa,bb,cc dd那么str中存入了aaa,bb,ccgetline(cin,str,',');原创 2018-01-08 11:14:12 · 1580 阅读 · 0 评论