各种输出读入(尽量用cin/cout)
来源:互联网 发布:掠食龙网络平台 编辑:程序博客网 时间:2024/06/14 00:32
cin/cout
优化:
ios::sync_with_stdio(false); cin.tie(NULL);
double输出:
#include <iomanip> cout<<setiosflags(ios::fixed)<<setprecision(6)<<ans;//6位小数
char输出读入:
int x; char ch[10]; cin>>ch>>x; cout<<ch<<" "<<x<<endl;
1.string字符串:
scanf("%s",str);
2.char单个字符:
ch=getchar();
3.char字符串:
char c[10]; gets(c);//从0开始
4.double精度小数点:
printf("%.6f\n",ans);
5long long:
windows下:
scanf("%I64d",&a); printf("%I64d",a);
Linux下:
scanf("%lld",&a); printf("%lld",a);
阅读全文
0 0
- 各种输出读入(尽量用cin/cout)
- C++输入cout与输出cin
- C++输入cout与输出cin
- C++输入cout与输出cin
- C++ 输入cin 和输出cout
- cout/cin(输出/输出)流限制输出宽度
- cin/cout
- cin & cout
- cin & cout
- cin &&cout
- cin cout
- cin cout
- cin&&cout
- cin cout
- cin cout
- cin cout
- C++ ACM 基础 cin重定向 cout 格式化输出
- C++输入与输出—cout和cin的用法
- Spring常用注解
- 最大子数组和
- 进程上下文与中断上下文
- 局部直方图均衡化 Matlab版
- Card Trick poj3032 软2的同学,还记得这道题吗
- 各种输出读入(尽量用cin/cout)
- LeetCode
- CodeForces
- 导数的概念及运算
- Struts2- (一)
- 知识图谱2-【浅谈知识图谱的构建技术】
- anaconda安装pyqt
- jedis入门
- JS 读取本地文件