摘要:1. 鸡蛋型解析式:x = 0.7*cos(t/4)*sin(t)y = cos(t)图像:python程序:import numpy as npimport matplotlib.pyplot as pltt = np.linspace(-np.pi, np.pi, 100)x = 0.7 * np.cos(t/4) * np.sin(t)y = -np.cos(t)plt.plot(x,y)plt.xlim(-1,1)plt.ylim(-1,1)plt.show()未完待续
阅读全文
摘要:#pragma warning (disable: 4786)#include#include#include#include#include#includeusing namespace std;#ifdef _WIN32typedef unsigned __int64 UINT64;#eliftypedef unsigned long long UINT64;#endif//1000以内素数表UINT64 gPrimeTable1000[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,
阅读全文
摘要:double dijkstra(int src, int dest, vector& path, vector >& adjT){ if (src = adjT.size() || dest = adjT.size()) return -1; map previous; //记录最短路径上每个点的前驱点 set V; //未计算的点 map distance; //记录src到各顶点的距离 int i; for (i=0; i::const_iterator it = adjT[src].find(i); if (it != ad...
阅读全文
摘要:// MandelbrotDlg.cpp : implementation file//#include "stdafx.h"#include "Mandelbrot.h"#include "MandelbrotDlg.h"#include #ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif//////////////////////////////////////////////////////////
阅读全文