sscanf和sprintf是scanf和printf家族用法sscanf和sprintf是scanf和printf家族的一对成员,用于处理和分析字符串非常强大得两个函数头文件 stdio.h原型int sscanf(const char *buffer,const char *format,......
分类:
其他好文 时间:
2014-07-16 22:59:38
阅读次数:
200
题目//找规律,123321123321123321…发现这样排列恰好可以错开// 其中注意题中数据范围: M是行,N是列,3 #include#include#includeusing namespace std;int main(){ int n, m; while( scanf( ...
分类:
其他好文 时间:
2014-07-16 22:55:54
阅读次数:
143
switch#include int main(int argc, char * argv[]){ int i; scanf("%d",&i); switch(i) { case 1: {printf("春"); break;...
分类:
移动开发 时间:
2014-07-16 21:46:08
阅读次数:
236
水题#include #include using namespace std;int main(){ int n; int c,sum1; double sum2; char str[10]; while(scanf("%d",&n)!=EOF) { ...
分类:
其他好文 时间:
2014-07-16 21:20:09
阅读次数:
173
```cpp#includeint a[100],ans ;int main(){ int n , t = 0 ; while (scanf("%d",&n)!=EOF) { for (int i=1; i0) ; ++t ; printf("C...
分类:
其他好文 时间:
2014-07-16 20:46:13
阅读次数:
137
A -Painting the sticks因为不能覆盖涂/涂两次,所以就数数有几个三个一块儿就行了。#includeint a[100],ans ;int main(){ int n , t = 0 ; while (scanf("%d",&n)!=EOF) { for (...
分类:
其他好文 时间:
2014-07-16 20:37:36
阅读次数:
317
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2014题目大意:去掉一个最高分和一个最低分求平均数。 1 #include 2 int main() 3 { 4 double n,a,i,s,max,min; 5 while(scanf...
分类:
其他好文 时间:
2014-07-13 11:01:58
阅读次数:
202
a题#include#includechar c[101][101];int main(){ long n,m,i,j; scanf("%ld%ld",&n,&m); gets(c[0]); for(i=1;i#include #include #include using ...
分类:
其他好文 时间:
2014-07-13 09:05:03
阅读次数:
195
C语言中一些很酷的技巧(cool tricks)
来自Quora,觉得不错,就实践了一下。
1. #if 0 ...... #endif 块中的内容不会被编译,因为注释不允许嵌套,我们可以把暂时不用的代码块放在
这里面。
2. 数组初始化的时候可以指定索引,而且可以给特定范围的数组赋值。
比如 int array[] = { [0 ... 9] = 1, [10 ......
分类:
编程语言 时间:
2014-07-12 19:30:20
阅读次数:
289
题目不难,但由于个人英语不好。。。。。
百度了下,题目意思是要求出字典序最小的并且不是所输入字符的子串;
也就是输出最多的连续的A;
如果没有A,输出一个A;
#include
#include
int main()
{
int a,i,j,b,c,d;
char t[105];
scanf("%d",&a);
while(a--)
{
d=1;
scanf("%s",t...
分类:
其他好文 时间:
2014-07-12 17:14:32
阅读次数:
152