码迷,mamicode.com
首页 >  
搜索关键字:gets    ( 3597个结果
C语言学习笔记-3.顺序结构程序设计
一、数据的输入与输出 1.stdio.h中包含的函数: getchar(输入字符) gets(输入字符串) printf(格式输出) putchar(输出字符) puts(输出字符串) scanf(格式输入) flushall(刷新缓冲区) 等等 2.flushall(); ...
分类:编程语言   时间:2015-02-04 09:23:16    阅读次数:233
UVa 673 (括号配对) Parentheses Balance
本来是当做水题来做的,后来发现这道题略坑。首先输入的字符串可能是空串,所以我用了gets函数,紧接着就被scanf("%d", &n)后面的换行符坑掉了。于是乎再加一句getchar() 1 #include 2 #include 3 #include 4 using namespace st...
分类:其他好文   时间:2015-02-04 00:27:19    阅读次数:331
(寒假CF3)B - 坑坑
题解:dpDescriptionAlex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game a...
分类:其他好文   时间:2015-02-03 22:37:26    阅读次数:104
斯坦福大学机器学习公开课:Programming Exercise 2: Logistic Regression
斯坦福大学机器学习公开课:Programming Exercise 2: Logistic Regression---Matlab实现 1 Logistic Regression In this part of the exercise, you will build a logistic regression model to predict whether astudent gets...
分类:其他好文   时间:2015-02-03 21:22:42    阅读次数:1109
深入了解scanf/getchar/gets/cin等函数
scanf(), getchar()等都是标准输入函数,一般人都会觉得这几个函数非常简单,没什么特殊的。但是有时候却就是因为使用这些函数除了问题,却找不出其中的原因。下面先看一个很简单的程序: 程序1: #include int main() { char ch1, ch2; scanf("%c", &ch1); scanf("%c", &ch2); printf("%d %d...
分类:其他好文   时间:2015-01-30 16:14:27    阅读次数:136
hihocoder #1094 : Lost in the City微软苏州校招笔试 12月27日 (建图不大【暴力枚举】 子图的4种形态 1Y )
#1094 : Lost in the City时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Hi gets lost in the city. He does not know where he is. He does not know which direc...
分类:其他好文   时间:2015-01-30 10:39:24    阅读次数:225
HDOJ 1048 The Hardest Problem Ever
【题意】:很普通的解码问题,所有的大写字母左移5位。注意A-E的移动是加21,其他的减5。 【代码:AC】 #include #include #include #include #include using namespace std; #define MAX 200+10 int main() { char str[MAX]; while (gets(str))...
分类:其他好文   时间:2015-01-30 00:05:37    阅读次数:184
UVA 227 Puzzle - 输入输出
题目:acm.hust.edu.cn/vjudge/roblem/viewProblem.action?id=19191这道题本身难度不大,但输入输出时需要特别小心,一不留神就会出问题。对于输入,如果要读入一行时:没有空白字符,则直接使用scanf和%s即可;有空白字符,使用gets,但要小心溢出;...
分类:其他好文   时间:2015-01-27 21:38:27    阅读次数:186
指针学习总结
1. 假设*p=a[20]; p[i]---表示a[i]; p+i---表示a[i]的地址2. 用scanf()函数输入中间不能有空格;否则要用gets()函数(只能有一个参数)3. 指向二维数组a[4][5]的*p,如果要表示a[i][j]则需要写成*(p+i*5+j)4. 用指针表示二维...
分类:其他好文   时间:2015-01-26 20:48:34    阅读次数:170
ACM 4描述 输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符。输入 第一行输入一个数N,表示有N组测试数据。后面的N行输入多组数据,每组输入数据都是占一行,
#include #include int main() {     int n;     int i,j;     char a[4];     int t;     char m;     scanf("%d",&n);getchar();     while(n--)     {         gets(a);                  j=strlen...
分类:其他好文   时间:2015-01-25 18:19:48    阅读次数:156
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!