标题:都说 cout强于printf,但是
取消只看楼主
chaos
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2004-6-10
 问题点数:0 回复次数:0 
都说 cout强于printf,但是

前面加个0用cout怎么做呢?

#include<stdio.h> #include<iostream.h> #include<iomanip.h> void main() { for(int i = 0; i < 10; i ++) { printf("%02d\t", i); //C的方法 cout << setw(2) << i << "\t"; //C++的方法,但是好像不能实现上面的功能阿 } }

[此贴子已经被作者于2004-06-28 21:39:06编辑过]

搜索更多相关主题的帖子: cout printf include void 
2004-06-28 21:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-2927-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.245826 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved