2014年数值分析(蔡懿慈) 实验题解
运行实验代码需要安装go
安装方法
- ubuntu
sudo apt-get install golang - archlinux
sudo pacman -S go - osx
brew install go - windows 下载二进制文件安装
每个实验独立一个go文件,相互之间没有依赖
| cmake_minimum_required(VERSION 3.7) | |
| project(fragmentsdemo) | |
| set(CMAKE_CXX_STANDARD 11) | |
| macro(SUBDIRLIST result curdir) | |
| file(GLOB children ${curdir}/*) | |
| set(dirlist "") | |
| foreach (child ${children}) | |
| message(STATUS ${child}) |
2014年数值分析(蔡懿慈) 实验题解
运行实验代码需要安装go
安装方法
sudo apt-get install golangsudo pacman -S gobrew install go每个实验独立一个go文件,相互之间没有依赖
| package main | |
| import ( | |
| "bufio" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "os" | |
| "strconv" | |
| "strings" |
| #include <stdio.h> | |
| #include <proc.h> | |
| #include <sem.h> | |
| #include <monitor.h> | |
| #include <assert.h> | |
| #define Chair 5 | |
| #define SLEEP_TIME 4 | |
| //----------理发师问题 使用信号量解法 |