码迷,mamicode.com
首页 >  
搜索关键字:cin getline    ( 8174个结果
Codeforces Round #195 (Div. 2) A. Vasily the Bear and Triangle
水题,注意数据范围即可#include #include #include using namespace std;typedef pair Point;int main(){ int x,y; cin >> x >>y; Point a,b; if((x>0 && y > ...
分类:其他好文   时间:2014-06-16 10:47:47    阅读次数:226
C++中对字符串进行插入、替换、删除操作
#include #include using std::cout; using std::endl; using std::cin; using std::string; int main(void){ string str1="We can insert a string"; string str2="a str into "; //在字符串指定位置...
分类:编程语言   时间:2014-06-15 19:29:30    阅读次数:251
C++中compare函数的使用
compare函数用来进行字符串以及其子串的比较,示例如下: #include #include #include using std::cout; using std::endl; using std::cin; using std::string; int main(void){ const int maxlength=100; string str1="hi,t...
分类:编程语言   时间:2014-06-15 08:52:26    阅读次数:287
Codeforces Round #249 (Div. 2) A. Black Square
水题#include #include #include using namespace std;int main(){ vector a(4); cin >> a[0] >> a[1]>>a[2]>>a[3]; string str; cin >> str; int res = 0; for(in...
分类:其他好文   时间:2014-06-14 23:00:14    阅读次数:249
Codeforces Round #245 (Div. 2) B - Balls Game
暴利搜索即可#include #include #include using namespace std;int main(){ int n,k,x; cin >> n >> k >> x; vector c(n); for(int i = 0 ; i > c[i]; ...
分类:其他好文   时间:2014-06-14 18:47:42    阅读次数:206
C++ 实现按随意键继续~~~
近期让学生敲代码交作业的时候要求他们仅仅给我交个cpp文件和一个exe文件,这样交上来的东西不至于太多,不占我的地方,可是有一个问题是exe它总是执行完后就直接关闭界面了,看不到执行结果的界面。然后我就教他们说,用一个cin语句,让界面停留一下等待用户输入,这样我们就能够看得到界面了。(我认为眼下为...
分类:编程语言   时间:2014-06-14 16:31:05    阅读次数:276
Java标准输入
Java: import java.util.*; public class Main{ public static void main(String args[]){ Scanner cin = new Scanner(System.in); int a, b; whil...
分类:编程语言   时间:2014-06-14 15:26:25    阅读次数:253
C++中cin流的简单使用
cin流可以用于读取标准输入流的一个字符,一行字符包含空格,多行字符等,示例如下: #include using std::cout; using std::endl; using std::cin; int main(void){ const int maxlength=100; char text[maxlength]={0}; char test=0; //...
分类:编程语言   时间:2014-06-14 07:46:55    阅读次数:321
寻找最大的数
#include#includeusing namespace std;char c[100],ans[100];int main(){ int len; cin>>len; while(len--) { cin>>c; int m; cin>>m; int len=strlen(c); int b...
分类:其他好文   时间:2014-06-12 07:40:23    阅读次数:215
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!