上一页 1 2 3 4 5 6 7 ··· 13 下一页
摘要: 项目名称:多人聊天室项目结构: client.py server.py settings.py项目思路:服务端接收客户端连接,客户端发送信息给服务端,服务端将信息发送给所有客户端。项目实现:主进程负责接收键盘输入(sys.stdin.readline),使用multiprocessing.Proce 阅读全文
posted @ 2019-12-18 21:44 no樂on 阅读(3487) 评论(0) 推荐(0) 编辑
摘要: 在C中实现string字符串,使用typedef将string定义为char *。 #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char* string; string get_string(string); 阅读全文
posted @ 2019-12-17 14:43 no樂on 阅读(719) 评论(0) 推荐(0) 编辑
摘要: C getchar() #include <stdio.h> int main() { int size = 5; char str[size]; int now = 0; char ch; printf("Enter whatever you want: "); while ((ch = getc 阅读全文
posted @ 2019-11-19 14:31 no樂on 阅读(129) 评论(0) 推荐(0) 编辑
摘要: C++ 数组遍历的两种方式: #include <iostream> using namespace std; int main() { // 一维数组 int fibonacci[5] = {1, 1, 2, 3, 5}; // 使用索引遍历 // 求数组长度:sizeof(array)/size 阅读全文
posted @ 2019-11-17 00:07 no樂on 阅读(13033) 评论(0) 推荐(0) 编辑
摘要: 使用Java实现发红包的功能。 结构: package redPocket User.java Manager.java Member.java Demo.java 思路: Manager和Member类继承User,Manager类实现群主发红包的功能,Member类实现群员收红包的功能。Demo 阅读全文
posted @ 2019-11-04 15:58 no樂on 阅读(288) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n; while (true) { 阅读全文
posted @ 2019-11-04 14:51 no樂on 阅读(633) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func f1() int { // 1、先执行返回值赋值,返回值等于x,等于5 // 2、执行defer语句,x++,x等于6 // 3、返回指令,返回返回值5 x := 5 defer func() { x++ // 修改的是x,不是返回值 }() return x } func f2() (x int) { // 1、先执行返回值赋值语句, 阅读全文
posted @ 2019-10-16 22:35 no樂on 阅读(226) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash # sum.sh # 获取随机数量的参数,相加并打印结果 # total=0 # # $# 表示参数的数量 # for 循环获取每个参数 # ${!i} 表示返回第i个参数 # for (( i = 1; i <= $#; i++ )) do total=$[ $total + ${!i} ] done # echo Total = $total # #!/bin/bash 阅读全文
posted @ 2019-09-15 13:29 no樂on 阅读(895) 评论(0) 推荐(0) 编辑
摘要: /* 一个统计字母(含大小写)出现次数的C程序 */ #include <stdio.h> int main() { char counts[52]; char ch; /* initialization */ for(int i = 0; i < sizeof(counts)/sizeof(cou 阅读全文
posted @ 2019-09-14 22:01 no樂on 阅读(253) 评论(0) 推荐(0) 编辑
摘要: /* linkedQueue.c */ /* 链队列 */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> /* 链队列数据结构 */ typedef struct node { int data; /* 节点存储数据 */ struct node *next; /* 指向下一个节点的指针 */ } Node; /* fron 阅读全文
posted @ 2019-09-09 18:47 no樂on 阅读(1420) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页