测试代码发布到博客效果(Windows Live Writer发布) public class SwitchCase { /** * 1、switch后面的表达式为常量表达式,类型只能是可以转化为int、enum(1.6+)、String(1.7+)的类型 * 2、可以转化为int类型的数据类型有:... ...
#include <stdio.h> #include <stdlib.h> int main() { for (float y = 1.5f; y > -1.5f; y -= 0.1f) { for (float x = -1.5f; x < 1.5f; x += 0.05f) { float a ...
分类:
编程语言 时间:
2016-05-30 01:02:58
阅读次数:
259
程序1.0思想:现将数组排序,再找出元素voidArraysort(int*a,intlength)//冒泡O(n^2)
{
for(size_ti=0;i<length;i++)
{
for(size_tj=1;j<length-1-i;j++)
{
if(a[j]>a[j+1])
swap(a[j],a[j+1]);
}
}
}
intMorethanHalfNumber(int*a,intlength)
{
Ar..
分类:
编程语言 时间:
2016-05-29 23:29:33
阅读次数:
196
#include<stdio.h>#include<stdlib.h>int main(){ #ifdef DEBUG printf("Compiled: " __DATE__ " at " __TIME__"\n" ); printf("This is line %d of file %s\n", ...
分类:
其他好文 时间:
2016-05-29 23:07:46
阅读次数:
184
#include<stdio.h> #include<stdlib.h> #include<time.h> double jieguo(); void main(){ int i,k; int m,n; int j; printf("请输入购买的号码:\n"); scanf("%d",&i); j= ...
分类:
编程语言 时间:
2016-05-29 22:53:12
阅读次数:
236
我们已经在本书中多次使用了函数sleep,我们也在图10.7以及图10.8中展示了两个有缺陷的sleep函数的实现。 #include unisgned int sleep(unsigned int seconds); Returns:0 or number of unslept seconds. ... ...
分类:
其他好文 时间:
2016-05-29 22:49:03
阅读次数:
3681
#include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #define N 100005 using namespace std; int read() { int x=0; char ch; bool bo ...
分类:
其他好文 时间:
2016-05-29 21:32:28
阅读次数:
192
概念 linux信号量:允许多个线程同时进入临界区,可以用于进程间的同步。 和互斥锁(mutex)的区别:互斥锁只允许一个线程进入临界区。 所在头文件:semaphore.h 主要函数 初始化函数 int sem_init(sem_t *sem, int pshared, unsigned int ...
分类:
系统相关 时间:
2016-05-29 21:26:47
阅读次数:
290
#include<cstdio> using namespace std; int a[101][101]; int main() { int m,n,i,j,b; scanf("%d%d",&n,&m); for(i=1;i<=n;i++) for(j=1;j<=m;j++) scanf("%d" ...
分类:
其他好文 时间:
2016-05-29 21:11:20
阅读次数:
173
codevs 1.1507 酒厂选址 1 #define N 10010 2 #include<iostream> 3 using namespace std; 4 #include<cstdio> 5 #include<cstring> 6 int sum[N],z[N],a[N]; 7 long ...
分类:
编程语言 时间:
2016-05-29 20:01:24
阅读次数:
193