描述一张CT扫描的灰度图像可以用一个N*N(0 2 using namespace std; 3 4 int main() { 5 int N; 6 int size = 0, circle = 0; 7 int i, j; 8 cin >> N; 9 ...
分类:
其他好文 时间:
2015-02-15 20:37:16
阅读次数:
218
I/O流的概念
一、流
1、含义:流是一个处于传输状态的字节序列,是字节在对象之间的“流动”,流的操作包括输入与输出。
2、作用:提供了灵活而易于使用的输入、输出机制,输入输出是数据传送的过程,数据如流水一样从一个位置流向另一个位置。
二、常用的流
1、cin为标准输入流对象,与提取运算符>>连用,用于输入。
2、cout为标准输出流对象,与...
分类:
编程语言 时间:
2015-02-13 16:38:38
阅读次数:
163
2015.2.13
1. cout cin 分别是istream osteam 类的一个对象,他们被写在文件iostream.h文件中;
2....
分类:
编程语言 时间:
2015-02-13 16:37:35
阅读次数:
198
getline读取整行文本”。书上给的程序如下:int main(){ string line: while(getline(cin,line)) cout<<line<<endl; return 0;}
分类:
其他好文 时间:
2015-02-13 11:21:28
阅读次数:
100
charstr[20];cin.getline(str,20)或stringstr;getline(cin,str);据说都可以存储含空格字符串,但我用VC6.0时都出错以下为粘贴关于在C++中输入带空格的字符串的方法yibcs2012-08-1020:44:17此人文章#include
<iostream>#include<stdio.h>#include
<string>usi..
分类:
其他好文 时间:
2015-02-10 15:32:31
阅读次数:
156
AC代码如下:
#include
#include
#include
#include
using namespace std;
const int maxn=201314;
int main()
{
int n,a[maxn];
while(cin>>n)
{
for(int i=0;i>a[i];
...
分类:
其他好文 时间:
2015-02-09 20:21:01
阅读次数:
102
#include
#include
#include
using namespace std;
int n,m;
char S[2100],P[2100];
int main()
{
#ifdef xxz
freopen("in.txt","r",stdin);
#endif // xxz
ios::sync_with_stdio(false);
cin.tie(0...
分类:
其他好文 时间:
2015-02-09 18:20:33
阅读次数:
138
#include
#include
using namespace std;
const int maxn = 250 * 250;
int main(){
char T;
cin >> T;
for (char k = 0; k > n >> p >> q;
int num[maxn];
memset(n...
分类:
其他好文 时间:
2015-02-09 00:51:08
阅读次数:
193
1. cin读取错误时对换行符的处理 1 #include 2 3 using namespace std; 4 5 int main() { 6 double d; 7 char c; 8 cin >> d; 9 if(!cin) {10 co...
分类:
编程语言 时间:
2015-02-08 23:08:14
阅读次数:
182
这一系列的练习主要在Virtual Judge上进行,题目为小白书上的题目推荐。UVa 10055注意两个数的大小关系,水题。#include using namespace std;int main(){ long long x, y; while(cin >> x >> y) { if(x >....
分类:
其他好文 时间:
2015-02-06 18:36:33
阅读次数:
176