码迷,mamicode.com
首页 >  
搜索关键字:gets    ( 3597个结果
统计C语言合法字符
#include #include int main(){ char a[51]; int i,t,n; while(scanf("%d",&n)!=EOF) {getchar(); while(n--) { t=0; gets(a); for(i=0;i122||(a[0]>90&&a[0...
分类:编程语言   时间:2015-04-29 00:21:46    阅读次数:236
统计字母和数字,打印出直方图
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int main(int argc, char* argv[]) 8 { 9 char ch[1024];10 gets(...
分类:其他好文   时间:2015-04-28 15:44:24    阅读次数:127
Who Gets the Most Candies?
Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 11303   Accepted: 3520 Case Time Limit: 2000MS Description N children are sitting in a circle to play a game. T...
分类:其他好文   时间:2015-04-27 15:23:10    阅读次数:123
(c语言)回文字符串的判断,gets和scanf
问题描述: 判断一个字符串是否是回文字符串。 程序分析: 回文字符串: 回文字符串是指一个字符中的最高位与最低位的字符是一样的,次高位和次低位上的字符是一样的,以此类推。同时,值得注意的是单个字符,或者多个重复的字符也是回文字符串。 (1)定义一个判断回文数的函数,按照上面给出的回文数的定义,我们进行判断。 (2)本程序在主函数传入字符串的过程中发现了用gets函数与用scanf函...
分类:编程语言   时间:2015-04-27 15:17:34    阅读次数:219
对一个字符数组连续用gets函数出现的问题(缓冲区内容补充)
昨天调试程序(见下面代码)遇到下面一个问题: #include int main() { int i = 1; while(i) { char str[100]; printf("please input a str:\n"); gets(str); puts(str); printf("continue:1,break:0\n"); scanf("%...
分类:编程语言   时间:2015-04-27 09:59:03    阅读次数:263
HDU ACM 2072单词数
分析:自从有了set、sstream中的istringstream与及string之后,这种问题也变水了,记得不要忘了STL或者是字符串类及字符流等工具哦!、 注意:重复的单词算一个。 #include #include #include using namespace std; int main() { char a[10001]; string b; while(gets(a) ...
分类:其他好文   时间:2015-04-27 09:53:49    阅读次数:105
在Activity生命周期中注册BroadcastReceiver和在配置文件中注册的区别
Setting up a BroadcastReceiver that gets called unnecessarily can be a drain on system resources. The sample application registers the?BroadcastReceiver?NetworkReceiver?in?onCreate(), and it un...
分类:其他好文   时间:2015-04-26 18:27:56    阅读次数:188
(C语言)回文字符串的判断
问题描述: 判断一个字符串是否为回文字符串。 程序分析: 回文字符串: (1)是一种特殊的字符串,有着不一样的特点。整个字符串中的每个元素的首尾是相同的,并且内容关于中间“对称”。 (2)写程序的时候,写一个函数,并且用指针实现判断功能,最后再调用这个函数。 (3)在写这个函数的时候,我在主函数里传入一个字符串可以用scanf也可以用gets函数。这个时候如果我想要连续判断字符串是否为...
分类:编程语言   时间:2015-04-26 16:47:18    阅读次数:249
模拟 ZOJ 3878 Convert QWERTY to Dvorak
题目传送门 1 /* 2 模拟:手敲map一一映射,累! 3 除了忘记读入字符串不能用gets用getline外还是很顺利的AC了:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 #in...
分类:其他好文   时间:2015-04-26 15:09:00    阅读次数:204
UVA253Cube painting骰子涂色
We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors....
分类:其他好文   时间:2015-04-26 15:04:55    阅读次数:142
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!