Continuous LearningClint ShankWE LiVE iN iNTERESTiNG TiMES. As development gets distributed across the globe, you learn there are lots of people capable of doing your job. You need to keep learning to...
分类:
其他好文 时间:
2015-04-19 13:14:21
阅读次数:
149
#includeint main(){ char a[100]; char max; int i; while(gets(a)) { max=a[0]; for(i=0;a[i]!='\0';i++) { ...
分类:
其他好文 时间:
2015-04-18 23:36:32
阅读次数:
120
1、cin>>用法1:最基本,也是最常用的用法,输入一个数字:#include using namespace std;main (){int a,b;cin>>a>>b;coutusing namespace std;main (){char a[20];cin>>a;coutusing name...
分类:
其他好文 时间:
2015-04-18 15:53:54
阅读次数:
144
/*1.不同点:
scanf不能接受空格、制表符Tab、回车等;
而gets能够接受空格、制表符Tab和回车等;
2.相同点:
字符串接受结束后自动加'\0'。 使用scanf("%s",&s);函数输入字符串时存在一个问题,就是如果输入了空格会认为字符串结束,空格后的字符将作为下一个输入项处理,但gets()函数将接收输入的整个字符串直到遇到换行为止*/
#includ...
分类:
编程语言 时间:
2015-04-18 10:05:06
阅读次数:
155
程序(已经accepted):
#include
int main()
{
char name[15][26];
int n, i;
int N = 1;
while(scanf("%d\n", &n) == 1 && n)
{
for(i=0; i<n; i++)
gets(name[i]);...
分类:
其他好文 时间:
2015-04-16 19:55:04
阅读次数:
127
#include #include char code[8][1 >k) &&k== '\n'); // 空行重读 if (k == -1) k = 0; else gets(s + 1); s[0] = k; return strlen(s);}voi...
分类:
其他好文 时间:
2015-04-16 13:56:45
阅读次数:
94
题意:
n个小孩站一圈,每个小孩拿一个数字,从第k个孩子开始出局,然后下一个出局的孩子是刚刚出局的孩子之前或之后第v个(刚刚出局的孩子的数字是+v则之后v个,-v则之前v个),这样所有孩子终将出局,第p个出局的孩子得f(p)分,f(p)定义为p的因子个数。求分数最高的孩子。
分析:
设顺时针为正方向,关键是模拟出每次出局的孩子是剩下的孩子中的正方向的第几个,设当前要出局的是第k个,然后要求出...
分类:
其他好文 时间:
2015-04-16 09:09:17
阅读次数:
209
#include "stdafx.h"#include #include void Squeeze(char s[],char c);int main(){char str[20],ch;printf_s("input a string:");gets_s(str);printf_s("input ...
分类:
其他好文 时间:
2015-04-13 18:14:43
阅读次数:
114
#include "stdafx.h"#include #include #include #define N 100void Insert(char s[]);int main(){char str[N];printf_s("input a string:");gets_s(str);Insert...
分类:
其他好文 时间:
2015-04-13 18:05:52
阅读次数:
102
#include #include int main(){ int t,i; char a[100];while(gets(a)!=NULL){ t=strlen(a); for(i=0;i<t;i++) { if(i==0) a[i]=a[i]-32; if(a[i]==' ') a[i+...
分类:
其他好文 时间:
2015-04-12 23:57:48
阅读次数:
303