码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
第一个c++程序
#include using namespace std;int main(int argc, const char * argv[]){//cin接收键盘输入 int age; double height; char name[10];// cout 在控制台输出一些信息// 相当于c语...
分类:编程语言   时间:2014-07-09 00:37:35    阅读次数:270
scanf printf gets() puts(),cin cout
最近在练机试题,常用的C和C++输入输出如下:1 scanf 和printfint a; scanf("%d",&a) ; printf("%d",a); printf("\n");double b;scanf("%");char c; scanf("%c",&c);printf("%c",c);l...
分类:其他好文   时间:2014-07-08 22:53:52    阅读次数:257
setw()函数使用
在C++中,setw(int n)用来控制输出间隔。例如:cout #include int main() { cout<<12345.0<<endl;//12345 cout<<setiosflags(ios::scientific)<<12345.0<<endl;//1.234500e+004....
分类:其他好文   时间:2014-07-07 00:03:20    阅读次数:537
【深度探索C++对象模型】data语义学
class X{};class Y :public virtual X{};class Z :public virtual X{};class A :public Y, public Z{};void main(){ cout x=0;当Point3D是一个derived class,而在其继...
分类:编程语言   时间:2014-07-06 15:28:39    阅读次数:241
用递归通过单字符输出打印多位的数字
#include using namespace std;void printDigit( int n ){ cout = 10 ) printOut( n / 10 ); printDigit( n % 10 );}int main( ){ printOut( 1...
分类:其他好文   时间:2014-07-06 13:05:31    阅读次数:222
C++学习笔记4
1.  输出缓冲区的刷新 我们的程序已经使用过endl 操纵符,用于输出一个换行符并刷新缓冲区。 除此之外,C++语言还提供了另外两个类似的操纵符。第一个经常使用的flush, 用于刷新流,但不在输出中添加任何字符。第二个则是比较少用的ends,这个 操纵符在缓冲区中插入空字符null,然后后刷新它:  cout  cout  cout 2. unitbuf 操纵符 如果...
分类:编程语言   时间:2014-07-06 11:53:03    阅读次数:267
Cocos2d-x lua游戏开发之安装Lua到mac系统
注意:mac ox ,lua version :5.15 下载lua官网的lua, 注意:最好是5.15以下,5.2的lua不支持table的getn()方法,这让我情何以堪。(获取table长度,相当与cout,size,length) 下载解压, cd 目录 make macosx sudo make install (是的,就是小写的install,虽然文件夹下的是INS...
分类:其他好文   时间:2014-07-06 08:40:44    阅读次数:187
c++中cin的基本用法
一、最基本的用法cin>>           接收一个数字、字符、字符串,遇“空格”、“TAB”、“回车”都结束           例如:         #include using namespace std; main () { int a,b; cin>>a>>b; cout<<a+b<<endl; }输入:5[回车]6[回车] 输出:11 (其中回车可替换成空格或者TA...
分类:编程语言   时间:2014-07-06 00:16:27    阅读次数:270
ACM:回溯法,子集生成
(一)增量构造法 #include #include using namespace std; const int MAXN = 1000; int A[MAXN], n; void print_subset(int n, int *A, int cur) { for(int i = 0; i < cur; ++i) cout << A[i] << " "; cout << endl...
分类:其他好文   时间:2014-07-04 08:06:43    阅读次数:224
C++ Primer Study Note 系列[1]-chapter1快速入门
Iwanttostudyitallthetime,andnowIamreadytostudythisbookinthenextmouth.Time:2014/07/02先看一个程序体验一下:#include<iostream> intmain() { /*Thisisatestexample*/ std::cout<<"Entertwonumbers:"<<std::endl; intv1,v2; std::cin>>v1>>v..
分类:编程语言   时间:2014-07-03 15:24:04    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!