上一页 1 2 3 4 5 6 7 8 ··· 14 下一页
摘要: 教室里有编号为1~50的电灯50盏,现全部处于关闭状态。六(一)班则好有50名同学,现依次进入教室,第一个同学将所有电灯都拉一下,第二个同学将编号为2的倍数的电灯各拉一下,第三个同学将编号为3的倍数的电灯各拉一下……,依此类推,直到最后一个同学操作完毕后,教室里共有几盏灯是亮着的?首先想到的是定义一个结构体typedef struct student{int a;bool flag;};第一种实现方式 结构体数组struct student st[50];int i,j=1,m;for (i=0;ia[i]=i+1; st->flag[i]=0;//0灯全部熄灭}//50个学生轮流关灯f 阅读全文
posted @ 2013-09-22 14:44 露水上的青蛙 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 上大学的时候一直在使用win_tc就因为使用方便,今天准备用这个工具编辑一个函数,就特意下载了一个。没想到直接出来一个bug。sizeof(char*)结果竟然是2.果断接卸,误人子弟啊。 阅读全文
posted @ 2013-09-22 10:47 露水上的青蛙 阅读(257) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "string.h"#include "stdlib.h"//#include typedef int ElemType;/* 创建链表式栈结构体*/typedef struct Stack_Node{ ElemType data; struct Stack_Node *next;}stack_node;/* 初始化栈*/stack_node* initStack(){struct Stack_Node *top;top=(struct Stack_Node*)malloc(siz 阅读全文
posted @ 2013-09-18 15:29 露水上的青蛙 阅读(506) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "string.h"#include "stdlib.h"//#include #define stack_size 2 //定义栈的初始化空间大小#define stack_add_size 3typedef int ElemType;typedef struct sqstack{ElemType *top;ElemType *bottom;int stacksize;//记录当前已分配的空间}sqStack;sqStack initStack(){sqstack s;s.bot 阅读全文
posted @ 2013-09-18 14:45 露水上的青蛙 阅读(347) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "string.h"void main(){int a[6];int j=0,tmp,i,t;memset(a,0,sizeof(a));while(1){if(j!=6){printf("请任意输入一个整数:");scanf("%d",&tmp);a[j]=tmp;j++;}else{printf("请任意输入一个整数---删除:");scanf("%d",&tmp);for (i=0;i<j;i+ 阅读全文
posted @ 2013-09-17 16:35 露水上的青蛙 阅读(112) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-09-17 09:05 露水上的青蛙 阅读(0) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include "stdio.h"#include using namespace std;#define MAXSIZE 50#define swap(a,b) a=a+b;b=a-b;a=a-b;typedef struct Node{int data;struct Node *next;}LNode;void Output(Node *p);void TailOutput(LNode *p);// 头插入法建链表LNode* HeadList(LNode *head){int i;LNode *p,*h;h 阅读全文
posted @ 2013-09-13 18:11 露水上的青蛙 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"static int a;int display(int m){static int b=2;//静态局部变量在编译时赋初值,即只赋值一次。运行设置断点可以检验//int b=0;//函数调用时赋值,必须初始化b = b + m;return b;}int _tmain(int argc, _TCHAR* argv[]){ int c; a = 3; printf("%d\n",a); c = display(a); printf("%d\n",c); c = display(a); printf 阅读全文
posted @ 2013-09-11 15:07 露水上的青蛙 阅读(148) 评论(0) 推荐(0) 编辑
摘要: package nine;import java.util.Random;class Value{int m;}public class eleven {static void prt(String s){System.out.println(s);}public static void main(String args[]){int i=1;System.out.println("i= "+(++i));System.out.println("i= "+(i++));Integer n1 = new Integer(22);Integer n2 = n 阅读全文
posted @ 2013-09-11 10:52 露水上的青蛙 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 创建文件夹mkdir 文件夹名称删除文件夹rm -rf 文件夹名称创建文件touch test.c删除文件rm -f test.c编译gcc -o test test.c在执行只语句后会生成一个*test运行./testesc+i 插入esc+x 删除一个字符 阅读全文
posted @ 2013-09-10 16:23 露水上的青蛙 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 14 下一页