码迷,mamicode.com
首页 >  
搜索关键字:gets    ( 3597个结果
uva--UVA 10201Adventures in Moving - Part IV
#include #include #include #include using namespace std; int dp[110][210],dis,t,n; int d[110],p[110]; char str[100]; void input() { gets(str); n=0; d[0]=0; sscanf(str,"%d",&dis);...
分类:其他好文   时间:2015-01-21 20:09:28    阅读次数:153
上机相关
1.关于C语言输入函数的注意事项 1.当输入单个字符时,用getchar或scanf("%c")时,要注意吸收换行符(因为换行符也是字符,其ASCII值为10)。 所以,比如要scanf("%d",&x),在此之后还要getchar()或gets()的话,那么要在它们之间一定要增加一...
分类:其他好文   时间:2015-01-14 00:40:41    阅读次数:273
getchar()、putchar()、gets()、puts()、cin.get()、cin.getline()、getline()
1.getchar:原型为int getchar(void).它从stdin里读取一个字符。返回值为用户输入的ASCⅡ码,出错返回-1。eg:c=getchar().2.putchar:原型为unsigned int putchar(char).在stdout上输出一个字符。当输出正确的时候,返回输...
分类:其他好文   时间:2015-01-11 17:44:42    阅读次数:223
Android中解析JSON形式的数据
JSONObject allresult; allresult = new JSONObject(strResult); String result = allresult.getString("result"); String uInfo = allresult.getS...
分类:移动开发   时间:2015-01-09 14:16:00    阅读次数:244
【模拟】bzoj2295 【POJ Challenge】我爱你啊
#include#includeusing namespace std;int n;char s[100001],table[]="luvletter";int main(){ scanf("%d",&n); getchar(); for(;n;--n) { gets(s); int...
分类:其他好文   时间:2015-01-06 11:28:24    阅读次数:152
cin/cin.get()/cin.getline()/getline()/gets()/getchar()
1、cin>>           用法1:最基本,也是最常用的用法,输入一个数字: #include using namespace std; main () { int a,b; cin>>a>>b; cout<<a+b<> 是会过滤掉不可见字符(如 空格 回车,TAB 等)  cin...
分类:其他好文   时间:2015-01-06 10:03:14    阅读次数:144
(简单) HDU 5154 Harry and Magical Computer,图论。
Description In reward of being yearly outstanding magic student, Harry gets a magical computer. When the computer begins to deal with a process, it w....
分类:其他好文   时间:2015-01-05 12:32:12    阅读次数:251
统计一个给定字符串中指定的字符出现的次数
统计一个给定字符串中指定的字符出现的次数 #include #include #include int main() { char source[80],dest[5]; int len_s,len_d,*count; int temp,i,j; while(1) { gets(dest); gets(source); if (strcmp(dest,"#")==...
分类:其他好文   时间:2015-01-04 23:08:06    阅读次数:253
华为机试—替换字符串中的字母
功能描述:将字符串中的字母全部替换成字母的下一个字母,要是最后一位是z或Z则替换为a或A。   *        输入:aBxyZ  *        输出:bCyzA #include #include int main() { char a[100]; gets(a); int len = strlen(a); for(int i=0;i<len;i++) ...
分类:其他好文   时间:2015-01-03 13:18:31    阅读次数:184
poj 2886 Who Gets the Most Candies? (线段树单点更新应用)
poj 2886 Who Gets the Most Candies? Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with ...
分类:其他好文   时间:2014-12-30 23:42:05    阅读次数:310
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!