- 博客(7)
- 收藏
- 关注
原创 STL编程:multiset容器完成学生成绩区间判断
初步实现:#include <iostream>#include <fstream>#include <sstream>#include <set>#include <string>using namespace std;/*class Resource{ int m_id; int m_score;};*/int main(){ char buf[20];
2017-12-08 21:53:14 345
原创 读者写者问题(Java多线程)
class DataFile{ //表示正在进行读取操作的人数 private int readerCount; //doreading 表示读信号量 当 doreading = true 时 表示有线程在读无法进行写操作 private boolean doreading; //dowriting 表示写信号量 当 dowriting = true 时 表
2017-12-08 21:46:47 2971
原创 生产者消费者问题(Java多线程)
import java.util.concurrent.locks.*;class ProducerConsumerDemo{ public static void main(String[] args) { Resource res =new Resource(); //煤 Producer pro = new Producer(
2017-12-08 21:45:39 207
原创 售票(多线程)
class Demo extends Thread{ private static int tickets = 20; private String name; Demo(String name) { super(name); } public void run() { /* for(int x=2
2017-12-08 21:43:01 258
原创 STL编程:两个多项式相加
//编制多项式加法的类#include <iostream>#include <list>#include <string>using namespace std;class Term //多项式项描述类{private: int coef;//系数 int exp;//指数public: Term(int coef,int exp):coef(coef),e
2017-12-08 21:23:24 837 2
原创 小红花问题(C++)
#include <iostream>#include <fstream>#include <vector>#include <bitset>#include <sstream>#include <string>#include <algorithm>using namespace std;class Child{public: int id; int atten
2017-12-08 21:07:39 1123
原创 银行家算法(C++)
#include <iostream>using namespace std;#define MAXPROCESS 50 //最大进程数#define MAXRESOURCE 100 //最大资源数int AVAILABLE[MAXRESOURCE]; //可用资源数组int MAX[MAXPROCESS][MAXRESOURCE]; //最大需求矩阵
2017-12-08 20:59:17 1118 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人