#include <iostream>
#include <cstring>
using namespace std;
class Employee
{
public:
virtual void pay(){ } // 第一题 这一行不要
string name;
float salary;
};
......................
阅读全部
|
gougoudan
贴于 2020年6月8日 15:24
hide
bbsi
#include <iostream>
#include <sstream>
#include <cstring>
#include <cassert>
using namespace std;
template <typename Type, int Count>
class Array
{
enum { sz = Count };
Type i[Count];
......................
阅读全部
|
gougoudan
贴于 2020年6月8日 11:41
hide
bbsi
#include "../require.h"
#include <iostream>
#include <sstream>
#include <cstring>
using namespace std;
template <typename Type, int Count>
class Array
{
enum { sz = Count };
Type i[Count];
......................
阅读全部
|
gougoudan
贴于 2020年6月8日 11:31
hide
bbsi
#include "stdio.h"
typedef unsigned char uint8;
void showBinary(const char* name, int c)
{
char res[32] = {};
char* p = &res[31];
for (int i = 8; i--; c >>= 1){
*--p = (c & 1) + '0';
}
printf("%s = %s", name, p);
}
......................
阅读全部
|
gougoudan
贴于 2020年6月7日 22:10
hide
bbsi
#include "stdio.h"
typedef unsigned char uint8;
void showBinary(const char* name, int c)
{
char res[32] = {};
char* p = &res[31];
for (int i = 8; i--; c >>= 1){
*--p = (c & 1) + '0';
}
printf("%s = %s", name, p);
}
......................
阅读全部
|
gougoudan
贴于 2020年6月7日 22:10
hide
bbsi
#include "stdio.h"
int main()
{
float money;
float k1;
int year, hour;
scanf("%d %d", &year, &hour);
if (year < 5)
k1 = 30;
else
k1 = 50;
......................
阅读全部
|
gougoudan
贴于 2020年6月7日 10:44
hide
bbsi
#include <iostream>
using namespace std;
struct HuffNode
{
float weight;
int parent;
int lchild;
int rchild;
};
//实现哈夫曼编码, 返回根节点
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 22:34
hide
bbsi
#include <iostream>
using namespace std;
struct HuffNode
{
float weight;
int parent;
int lchild;
int rchild;
};
//实现哈夫曼编码, 返回根节点
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 22:34
hide
bbsi
#include <stdio.h>
float func(int n, int x)
{
float fn;
if (n == 0) return 1;
if (n == 1) return x;
fn = (float)n;
return ((2 * fn - 1) * x * func(n - 1, x) - (fn - 1) * func(n - 2, x)) / fn;
}
int main()
{
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 21:15
hide
bbsi
#include <iostream>
#include <algorithm>
using namespace std;
void showarray(int a[], int c, int d)
{
for (int i = 0; i < c; ++i)
cout << a[i] << ' ';
cout << endl;
}
//对a[low]到a[high]由小到大排序
bool QuickSort(int a[], int count, int teamIdx)
{
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 19:43
hide
bbsi