-
srand[getpid[]]
/* initialize some of the memory */
memset[heightmap, 0, MAPSIZE*MAPSIZE]
memset[vpage, 0, RENDERWIDTH * RENDERHEIGHT]
printf["Creating dx d fractal terrain\n", MAPSIZE, MAPSIZE]
heightmap[0] = [rand[] 128] + 64 // initialize starting point on map
CreateFractalMap[0, 0, MAPSIZE, MAPSIZE]
printf["Smoothing terrain\n"]
for [i = 0 i < 5 i++]
SmoothMap[]
MakeColorMap[]
標(biāo)簽:
MAPSIZE
initialize
heightmap
getpid
上傳時(shí)間:
2013-12-25
上傳用戶:CSUSheep
-
找一個(gè)最小的自然數(shù),使它等于不同的兩組三個(gè)自然數(shù)的三次冪之和,即找最小的x,使得:x=a*a*a+b*b*b+c*c*c = d*d*d+e*e*e+f*f*f 其中,a,b,c,d,e,f都是自然數(shù),a<=b<=c, d<=e<=f [a,b,c]!=[d,e,f]
進(jìn)一步,是否還存在另外一個(gè)自然數(shù)滿足上述條件,可能的話請(qǐng)輸出其結(jié)果
標(biāo)簽:
上傳時(shí)間:
2017-05-16
上傳用戶:vodssv
-
P3.20. Consider an analog signal xa (t) = sin (2πt), 0 ≤t≤ 1. It is sampled at Ts = 0.01, 0.05,
and 0.1 sec intervals to obtain x(n).
b) Reconstruct the analog signal ya (t) from the samples x(n) using the sinc interpolation
(use ∆ t = 0.001) and determine the frequency in ya (t) from your plot. (Ignore the end
effects.)
C) Reconstruct the analog signal ya (t) from the samples x (n) using the cubic spline
interpolation and determine the frequency in ya (t) from your plot. (Ignore the end effects.)
標(biāo)簽:
Consider
sampled
analog
signal
上傳時(shí)間:
2017-07-12
上傳用戶:咔樂塢
-
g a w k或GNU awk是由Alfred V. A h o,Peter J.We i n b e rg e r和Brian W. K e r n i g h a n于1 9 7 7年為U N I X創(chuàng)建的a w k編程語言的較新版本之一。a w k出自創(chuàng)建者姓的首字母。a w k語言(在其所有的版本中)是一種具有很強(qiáng)能力的模式匹配和過程語言。a w k獲取一個(gè)文件(或多個(gè)文件)來查找匹配特定模式的記錄。當(dāng)查到匹配后,即執(zhí)行所指定的動(dòng)作。作為一個(gè)程序員,你不必操心通過文件打開、循環(huán)讀每個(gè)記錄,控制文件的結(jié)束,或執(zhí)行完后關(guān)閉文件。
標(biāo)簽:
V.
Alfred
GNU
awk
上傳時(shí)間:
2014-01-02
上傳用戶:hwl453472107
-
RSA ( Rivest Shamir Adleman )is crypthograph system that used to give a secret information and digital signature . Its security based on Integer Factorization Problem (IFP). RSA uses an asymetric key. RSA was created by Rivest, Shamir, and Adleman in 1977. Every user have a pair of key, public key and private key. Public key (e) . You may choose any number for e with these requirements, 1< e <Æ (n), where Æ (n)= (p-1) (q-1) ( p and q are first-rate), gcd (e,Æ (n))=1 (gcd= greatest common divisor). Private key (d). d=(1/e) mod(Æ (n)) Encyption (C) . C=Mª mod(n), a = e (public key), n=pq Descryption (D) . D=C° mod(n), o = d (private key
標(biāo)簽:
crypthograph
information
Adleman
Rivest
上傳時(shí)間:
2017-09-01
上傳用戶:chfanjiang
-
module M_GAUSS
!高斯列主元消去法模塊
contains
subroutine LINEQ(A,B,X,N)
!高斯列主元消去法
implicit real*8(A-Z)
integer::I,K,N
integer::ID_MAX !主元素標(biāo)號(hào)
real*8::A(N,N),B(N),X(N)
real*8::AUP(N,N),BUP(N)
!A,B為增廣矩陣
real*8::AB(N,N+1)
real*8::VTEMP1(N+1),VTEMP2(N+1)
AB(1:N,1:N)=A
AB(:,N+1)=B
標(biāo)簽:
fortan
Newton
程序
數(shù)值分析
方程
非線性
上傳時(shí)間:
2018-06-15
上傳用戶:answer123
-
#include <stdio.h>
#include <stdlib.h>
#define SMAX 100
typedef struct SPNode
{
int i,j,v;
}SPNode;
struct sparmatrix
{
int rows,cols,terms;
SPNode data [SMAX];
};
sparmatrix CreateSparmatrix()
{
sparmatrix A;
printf("\n\t\t請(qǐng)輸入稀疏矩陣的行數(shù),列數(shù)和非零元素個(gè)數(shù)(用逗號(hào)隔開):");
scanf("%d,%d,%d",&A.cols,&A.terms);
for(int n=0;n<=A.terms-1;n++)
{
printf("\n\t\t輸入非零元素值(格式:行號(hào),列號(hào),值):");
scanf("%d,%d,%d",&A.data[n].i,&A.data[n].j,&A.data[n].v);
}
return A;
}
void ShowSparmatrix(sparmatrix A)
{
int k;
printf("\n\t\t");
for(int x=0;x<=A.rows-1;x++)
{
for(int y=0;y<=A.cols-1;y++)
{
k=0;
for(int n=0;n<=A.terms-1;n++)
{
if((A.data[n].i-1==x)&&(A.data[n].j-1==y))
{
printf("%8d",A.data[n].v);
k=1;
}
}
if(k==0)
printf("%8d",k);
}
printf("\n\t\t");
}
}
void sumsparmatrix(sparmatrix A)
{
SPNode *p;
p=(SPNode*)malloc(sizeof(SPNode));
p->v=0;
int k;
k=0;
printf("\n\t\t");
for(int x=0;x<=A.rows-1;x++)
{
for(int y=0;y<=A.cols-1;y++)
{
for(int n=0;n<=A.terms;n++)
{
if((A.data[n].i==x)&&(A.data[n].j==y)&&(x==y))
{
p->v=p->v+A.data[n].v;
k=1;
}
}
}
printf("\n\t\t");
}
if(k==1)
printf("\n\t\t對(duì)角線元素的和::%d\n",p->v);
else
printf("\n\t\t對(duì)角線元素的和為::0");
}
int main()
{
int ch=1,choice;
struct sparmatrix A;
A.terms=0;
while(ch)
{
printf("\n");
printf("\n\t\t 稀疏矩陣的三元組系統(tǒng) ");
printf("\n\t\t*********************************");
printf("\n\t\t 1------------創(chuàng)建 ");
printf("\n\t\t 2------------顯示 ");
printf("\n\t\t 3------------求對(duì)角線元素和");
printf("\n\t\t 4------------返回 ");
printf("\n\t\t*********************************");
printf("\n\t\t請(qǐng)選擇菜單號(hào)(0-3):");
scanf("%d",&choice);
switch(choice)
{
case 1:
A=CreateSparmatrix();
break;
case 2:
ShowSparmatrix(A);
break;
case 3:
SumSparmatrix(A);
break;
default:
system("cls");
printf("\n\t\t輸入錯(cuò)誤!請(qǐng)重新輸入!\n");
break;
}
if (choice==1||choice==2||choice==3)
{
printf("\n\t\t");
system("pause");
system("cls");
}
else
system("cls");
}
}
標(biāo)簽:
數(shù)組
子系統(tǒng)
上傳時(shí)間:
2020-06-11
上傳用戶:ccccy
-
摘# 要:設(shè)計(jì)和制作了一款&& ?G(!& )*)液晶電視用4F9 背光源。模擬出4F9 的光學(xué)分布,以此為基礎(chǔ)模擬出4F9 陣列的光強(qiáng)和顏色分布,得到適合的背光源厚度尺寸。在實(shí)際制作中,采用高效的驅(qū)動(dòng)電路對(duì)4F9 陣列進(jìn)行驅(qū)動(dòng),利用鋁制散熱片為背光源提供必須的散熱。測(cè)試的結(jié)果,在整體背光源功耗為"$% M 時(shí),中心亮度達(dá)到"D DE% ?6 N G!,均勻度為CO@ " P,色彩還原性達(dá)到=QR’ 標(biāo)準(zhǔn)"%! P,遠(yuǎn)遠(yuǎn)超過’’S4 背光源的A% P。
標(biāo)簽:
led
光源
上傳時(shí)間:
2021-12-09
上傳用戶:
-
dsp hư ớ ng dẫ n giao tiế p LCD code viế t bằ ng C
標(biāo)簽:
7871
7899
7851
7857
上傳時(shí)間:
2017-06-17
上傳用戶:xuanjie
-
四柱漢諾塔問題的求解程序.解題思路:如a,b,c,d四柱. 要把a(bǔ)柱第n個(gè)盤移到目標(biāo)柱子(d柱),先把上層
分兩為兩部份,上半部份移到b柱,下半部分移到c柱,再把第n盤移到
目標(biāo)柱子,然后,c柱盤子再移到目標(biāo)柱子,再把b柱盤子移到目標(biāo)柱子.
細(xì)節(jié)地方:
上半部份移到b柱時(shí),它的中間變量柱子是有二選一的.而下半部分
移到c柱時(shí),它的中間變量柱子只有一個(gè)(因?yàn)橐粋€(gè)柱子已被上半部份
占了).b,c也移到目標(biāo)柱子時(shí)同理。
標(biāo)簽:
分
漢
程序
上傳時(shí)間:
2013-12-22
上傳用戶:aeiouetla