-
#include<iom16v.h>
#include<macros.h>
#define uint unsigned int
#define uchar unsigned char
uint a,b,c,d=0;
void delay(c)
{ for for(a=0;a<c;a++)
for(b=0;b<12;b++);
};
uchar tab[]={
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,
標簽:
AVR
單片機
數碼管
上傳時間:
2013-10-21
上傳用戶:13788529953
-
源代碼\用動態規劃算法計算序列關系個數
用關系"<"和"="將3個數a,b,c依次序排列時,有13種不同的序列關系:
a=b=c,a=b<c,a<b=v,a<b<c,a<c<b
a=c<b,b<a=c,b<a<c,b<c<a,b=c<a
c<a=b,c<a<b,c<b<a
若要將n個數依序列,設計一個動態規劃算法,計算出有多少種不同的序列關系,
要求算法只占用O(n),只耗時O(n*n).
標簽:
lt
源代碼
動態規劃
序列
上傳時間:
2013-12-26
上傳用戶:siguazgb
-
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d .
Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet.
Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1.
Definition
標簽:
government
streamline
important
alphabet
上傳時間:
2015-06-09
上傳用戶:weixiao99
-
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
標簽:
represented
integers
group
items
上傳時間:
2016-01-17
上傳用戶:jeffery
-
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa.
For example,
>> project.name = MyProject
>> project.id = 1234
>> project.param.a = 3.1415
>> project.param.b = 42
becomes with str=xml_format(project, off )
"<project>
<name>MyProject</name>
<id>1234</id>
<param>
<a>3.1415</a>
<b>42</b>
</param>
</project>"
On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
標簽:
converts
Toolbox
complex
logical
上傳時間:
2016-02-12
上傳用戶:a673761058
-
實驗源代碼
//Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("請輸入矩陣第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可傳遞閉包關系矩陣是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元關系的可傳遞閉包\n"); void warshall(int,int); int k , n; printf("請輸入矩陣的行數 i: "); scanf("%d",&k);
四川大學實驗報告 printf("請輸入矩陣的列數 j: "); scanf("%d",&n); warshall(k,n); }
標簽:
warshall
離散
實驗
上傳時間:
2016-06-27
上傳用戶:梁雪文以
-
#include "iostream" using namespace std;
class Matrix
{
private:
double** A; //矩陣A
double *b; //向量b
public:
int size;
Matrix(int );
~Matrix();
friend double* Dooli(Matrix& );
void Input();
void Disp();
};
Matrix::Matrix(int x) {
size=x;
//為向量b分配空間并初始化為0
b=new double [x];
for(int j=0;j<x;j++)
b[j]=0;
//為向量A分配空間并初始化為0
A=new double* [x];
for(int i=0;i<x;i++)
A[i]=new double [x];
for(int m=0;m<x;m++)
for(int n=0;n<x;n++)
A[m][n]=0;
}
Matrix::~Matrix() {
cout<<"正在析構中~~~~"<<endl;
delete b;
for(int i=0;i<size;i++)
delete A[i];
delete A;
}
void Matrix::Disp()
{
for(int i=0;i<size;i++)
{
for(int j=0;j<size;j++)
cout<<A[i][j]<<" ";
cout<<endl;
}
}
void Matrix::Input()
{
cout<<"請輸入A:"<<endl;
for(int i=0;i<size;i++)
for(int j=0;j<size;j++){
cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl;
cin>>A[i][j];
}
cout<<"請輸入b:"<<endl;
for(int j=0;j<size;j++){
cout<<"第"<<j+1<<"個:"<<endl;
cin>>b[j];
}
}
double* Dooli(Matrix& A) {
double *Xn=new double [A.size];
Matrix L(A.size),U(A.size);
//分別求得U,L的第一行與第一列
for(int i=0;i<A.size;i++)
U.A[0][i]=A.A[0][i];
for(int j=1;j<A.size;j++)
L.A[j][0]=A.A[j][0]/U.A[0][0];
//分別求得U,L的第r行,第r列
double temp1=0,temp2=0;
for(int r=1;r<A.size;r++){
//U
for(int i=r;i<A.size;i++){
for(int k=0;k<r-1;k++)
temp1=temp1+L.A[r][k]*U.A[k][i];
U.A[r][i]=A.A[r][i]-temp1;
}
//L
for(int i=r+1;i<A.size;i++){
for(int k=0;k<r-1;k++)
temp2=temp2+L.A[i][k]*U.A[k][r];
L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r];
}
}
cout<<"計算U得:"<<endl;
U.Disp();
cout<<"計算L的:"<<endl;
L.Disp();
double *Y=new double [A.size];
Y[0]=A.b[0];
for(int i=1;i<A.size;i++ ){
double temp3=0;
for(int k=0;k<i-1;k++)
temp3=temp3+L.A[i][k]*Y[k];
Y[i]=A.b[i]-temp3;
}
Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1];
for(int i=A.size-1;i>=0;i--){
double temp4=0;
for(int k=i+1;k<A.size;k++)
temp4=temp4+U.A[i][k]*Xn[k];
Xn[i]=(Y[i]-temp4)/U.A[i][i];
}
return Xn;
}
int main()
{
Matrix B(4);
B.Input();
double *X;
X=Dooli(B);
cout<<"~~~~解得:"<<endl;
for(int i=0;i<B.size;i++)
cout<<"X["<<i<<"]:"<<X[i]<<" ";
cout<<endl<<"呵呵呵呵呵";
return 0;
}
標簽:
道理特分解法
上傳時間:
2018-05-20
上傳用戶:Aa123456789
-
資源包含以下內容:1.GBT2423.07-1995 電工電子產品環境試驗第2部分 試驗方法試驗ec和導則傾跌與翻倒(主要用于設備型樣品).pdf2.GBT2423.08-1995 電工電子產品環境試驗第2部分 試驗方法試驗ed自由跌落.pdf3.GBT2423.09-2001 電工電子產品環境試驗第2部分 試驗方法試驗cb設備用恒定濕熱.pdf4.GBT2423.10-1995 電工電子產品環境試驗第2部分 試驗方法試驗fc和導則振動(正弦).pdf5.GBT2423.11-1997 電工電子產品環境試驗第2部分 試驗方法試驗fd寬頻帶隨機振動--一般要求 .pdf6.GBT2423.12-1997 電工電子產品環境試驗第2部分 試驗方法試驗fda寬頻帶隨機振動--高再現性.pdf7.GBT2423.13-1997 電工電子產品環境試驗第2部分 試驗方法試驗fdb寬頻帶隨機振動中再現性.pdf8.GBT2423.14-1997 電工電子產品環境試驗第2部分 試驗方法試驗fdc寬頻帶隨機振動低再現性.pdf9.GBT2423.15-1995 電工電子產品環境試驗第2部分 試驗方法試驗ga和導則穩態加速度.pdf10.GBT2423.16-1999 電工電子產品環境試驗第2部分 試驗方法試驗j和導則長霉.pdf11.GBT2423.17-1993 電工電子產品基本環境試驗規程試驗ka 鹽霧試驗方法.pdf12.GBT2423.18-2000 電工電子產品環境試驗第二部分 試驗--試驗kb 鹽霧,交變(氯化鈉溶液).pdf13.GBT2423.19-1981 電工電子產品基本環境試驗規程試驗kc 接觸點和連接件的二氧化硫試驗方法.pdf14.GBT2423.20-1981 電工電子產品基本環境試驗規程試驗kd 接觸點和連接件的硫化氫試驗方法.pdf15.GBT2423.21-1991 電工電子產品基本環境試驗規程試驗m 低氣壓試驗方法.pdf16.GBT2423.22-2002 電工電子產品環境試驗第2部分試驗方法試驗n 溫度變化.pdf17.GBT2423.23-1995 電工電子產品環境試驗試驗q 密封.pdf18.GBT2423.24-1995 電工電子產品環境試驗第二部分 試驗方法試驗sa 模擬地面上的太陽輻射.pdf19.GBT2423.25-1992 電工電子產品基本環境試驗規程試驗zam 低溫低氣壓綜合試驗.pdf20.GBT2423.26-1992 電工電子產品基本環境試驗規程試驗zbm 高溫低氣壓綜合試驗.pdf21.GBT2423.27-1981 電工電子產品基本環境試驗規程試驗zamd 低溫低氣壓濕熱連續綜合試驗方法.pdf22.GBT2423.28-1982 電工電子產品基本環境試驗規程試驗t 錫焊試驗方法.pdf23.GBT2423.29-1999 電工電子產品環境試驗第2部分試驗方法試驗u 引出端及整體安裝件強度.pdf24.GBT2423.30-1999 電工電子產品環境試驗第2部分試驗方法試驗xa 和導則在清洗劑中浸漬.pdf25.GBT2423.31-1985 電工電子產品基本環境試驗規程傾斜和搖擺試驗方法.pdf26.GBT2423.32-1985 電工電子產品基本環境試驗規程潤濕稱量法可焊性試驗方法.pdf27.GBT2423.33-1989 電工電子產品基本環境試驗規程試驗kca 高濃度二氧化硫試驗方法.pdf28.GBT2423.34-1986 電工電子產品基本環境試驗規程試驗zad 溫度濕度組合循環試驗方法.pdf29.GBT2423.35-1986 電工電子產品基本環境試驗規程試驗zafc 散熱和非散熱試驗樣品的低溫振動(正弦)綜合試驗方法.pdf30.GBT2423.36-1986 電工電子產品基本環境試驗規程試驗zbfc 散熱和非散熱樣品的高溫振動(正弦)綜合試驗方法.pdf31.GBT2423.37-1989 電工電子產品基本環境試驗規程試驗l砂塵試驗方法.pdf32.GBT2423.38-1990 電工電子產品基本環境試驗規程試驗r 水試驗方法.pdf33.GBT2423.39-1990 電工電子產品基本環境試驗規程試驗ee 彈跳試驗方法.pdf34.GBT2423.40-1997 電工電子產品環境試驗第2部分試驗方法試驗cx 未飽和高壓蒸汽恒定濕熱.pdf35.GBT2423.41-1994 電工電子產品基本環境試驗規程風壓試驗方法.pdf36.GBT2423.42-1995 工電子產品環境試驗低溫低氣壓振動(正弦)綜合試驗方法.pdf37.GBT2423.43-1995 電工電子產品環境試驗第二部分 試驗方法元件、設備和其他產品在沖擊,碰撞,振動,和穩態加速度,等動力學試驗中的安裝要求和導則.pdf38.GBT2423.44-1995 電工電子產品環境試驗第二部分 試驗方法試驗eg 撞擊彈簧錘.pdf39.GBT2423.45-1997 電工電子產品環境試驗第2部分:試驗方法試驗zabdm:氣候順序.pdf40.GBT2423.46-1997 電工電子產品環境試驗第2部分:試驗方法試驗ef:撞擊擺錘.pdf41.GBT2423.47-1997 電工電子產品環境試驗第2部分 試驗方法試驗fg 聲振.pdf42.GBT2423.48-1997 電工電子產品環境試驗第2部分 試驗方法試驗ff 振動--時間歷程法.pdf43.GBT2423.49-1997 電工電子產品環境試驗第2部分 試驗方法試驗fe 振動--正弦拍頻法.pdf44.GBT2423.50-1999 電工電子產品環境試驗第2部分 試驗方法試驗cy 恒定濕熱主要用于元件的加速試驗.pdf45.GBT2423.51-2000 電工電子產品環境試驗第2部分 試驗方法試驗ke 流動混合氣體腐蝕試驗.pdf46.電子產品老化相關標準資料
標簽:
網站
上傳時間:
2013-04-15
上傳用戶:eeworm
-
01引論篇.rar
02_51單片機簡介.rar
03.C51基礎.rar
04.搭建開發環境.rar
05.軟件調試.rar
06.流水燈1.rar
07.流水燈2.rar
08蜂鳴器和繼電器.rar
09.步進電機驅動.rar
10.數碼管靜態顯示和動態顯示.rar
11.8乘8LED點陣驅動.rar
12.獨立按鍵檢測.rar
13.矩陣鍵盤掃描檢測.rar
14.外部中斷的原理和應用.rar
…………
標簽:
LabVIEW
part
01
高級編程
上傳時間:
2013-04-15
上傳用戶:eeworm
-
1.24位真彩色->256色灰度圖。
2.預處理:中值濾波。
3.二值化:用一個初始閾值T對圖像A進行二值化得到二值化圖像B。
初始閾值T的確定方法是:選擇閾值T=Gmax-(Gmax-Gmin)/3,Gmax和Gmin分別是最高、最低灰度值。
該閾值對不同牌照有一定的適應性,能夠保證背景基本被置為0,以突出牌照區域。
4.削弱背景干擾。對圖像B做簡單的相鄰像素灰度值相減,得到新的圖像G,即Gi,j=|Pi,j-Pi,j-1|i=0,1,…,439 j=0,1,…,639Gi,0=Pi,0,左邊緣直接賦值,不會影響整體效果。
5.用自定義模板進行中值濾波
區域灰度基本被賦值為0。考慮到文字是由許多短豎線組成,而背景噪聲有一大部分是孤立噪聲,用模板(1,1,1,1,1)T對G進行中值濾波,能夠得到除掉了大部分干擾的圖像C。
6.牌照搜索:利用水平投影法檢測車牌水平位置,利用垂直投影法檢測車牌垂直位置。
7.區域裁剪,截取車牌圖像。
標簽:
Gmax-G
1.24
Gmax
閾值
上傳時間:
2014-01-08
上傳用戶:songrui