-
Computation of loudness (Zwicker model) according to ISO 532B / DIN 45631 norms.
This model is valid for steady sounds.
Code based on BASIC program published in the following article:
Program for calculating loudness according to DIN 45 631 (ISO 532B)",
E.Zwicker and H.Fastl, J.A.S.J (E) 12, 1 (1991).
標簽:
計算
聲學
上傳時間:
2016-11-14
上傳用戶:zztony16
-
void DFS(MGraph G, int i)
{
int j;
visited[i] = TRUE;
printf("%c ", G.vexs[i]);
for (j=0; j<G.numVertexes; ++j)
{
if (G.arc[i][j]!=INFINITY && !visited[j])
DFS(G, j);
}
}
標簽:
多項式
代碼
計算
上傳時間:
2016-12-28
上傳用戶:chenyameng
-
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NULL 0
#define MaxSize 30
typedef struct athletestruct /*運動員*/
{
char name[20];
int score; /*分數*/
int range; /**/
int item; /*項目*/
}ATH;
typedef struct schoolstruct /*學校*/
{
int count; /*編號*/
int serial; /**/
int menscore; /*男選手分數*/
int womenscore; /*女選手分數*/
int totalscore; /*總分*/
ATH athlete[MaxSize]; /**/
struct schoolstruct *next;
}SCH;
int nsc,msp,wsp;
int ntsp;
int i,j;
int overgame;
int serial,range;
int n;
SCH *head,*pfirst,*psecond;
int *phead=NULL,*pafirst=NULL,*pasecond=NULL;
void create();
void input ()
{
char answer;
head = (SCH *)malloc(sizeof(SCH)); /**/
head->next = NULL;
pfirst = head;
answer = 'y';
while ( answer == 'y' )
{
Is_Game_DoMain:
printf("\nGET Top 5 when odd\nGET Top 3 when even");
printf("\n輸入運動項目序號 (x<=%d):",ntsp);
scanf("%d",pafirst);
overgame = *pafirst;
if ( pafirst != phead )
{
for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )
{
if ( overgame == *pasecond )
{
printf("\n這個項目已經存在請選擇其他的數字\n");
goto Is_Game_DoMain;
}
}
}
pafirst = pafirst + 1;
if ( overgame > ntsp )
{
printf("\n項目不存在");
printf("\n請重新輸入");
goto Is_Game_DoMain;
}
switch ( overgame%2 )
{
case 0: n = 3;break;
case 1: n = 5;break;
}
for ( i = 1 ; i <= n ; i++ )
{
Is_Serial_DoMain:
printf("\n輸入序號 of the NO.%d (0<x<=%d): ",i,nsc);
scanf("%d",&serial);
if ( serial > nsc )
{
printf("\n超過學校數目,請重新輸入");
goto Is_Serial_DoMain;
}
if ( head->next == NULL )
{
create();
}
psecond = head->next ;
while ( psecond != NULL )
{
if ( psecond->serial == serial )
{
pfirst = psecond;
pfirst->count = pfirst->count + 1;
goto Store_Data;
}
else
{
psecond = psecond->next;
}
}
create();
Store_Data:
pfirst->athlete[pfirst->count].item = overgame;
pfirst->athlete[pfirst->count].range = i;
pfirst->serial = serial;
printf("Input name:) : ");
scanf("%s",pfirst->athlete[pfirst->count].name);
}
printf("\n繼續輸入運動項目(y&n)?");
answer = getchar();
printf("\n");
}
}
void calculate() /**/
{
pfirst = head->next;
while ( pfirst->next != NULL )
{
for (i=1;i<=pfirst->count;i++)
{
if ( pfirst->athlete[i].item % 2 == 0 )
{
switch (pfirst->athlete[i].range)
{
case 1:pfirst->athlete[i].score = 5;break;
case 2:pfirst->athlete[i].score = 3;break;
case 3:pfirst->athlete[i].score = 2;break;
}
}
else
{
switch (pfirst->athlete[i].range)
{
case 1:pfirst->athlete[i].score = 7;break;
case 2:pfirst->athlete[i].score = 5;break;
case 3:pfirst->athlete[i].score = 3;break;
case 4:pfirst->athlete[i].score = 2;break;
case 5:pfirst->athlete[i].score = 1;break;
}
}
if ( pfirst->athlete[i].item <=msp )
{
pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;
}
else
{
pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;
}
}
pfirst->totalscore = pfirst->menscore + pfirst->womenscore;
pfirst = pfirst->next;
}
}
void output()
{
pfirst = head->next;
psecond = head->next;
while ( pfirst->next != NULL )
{
// clrscr();
printf("\n第%d號學校的結果成績:",pfirst->serial);
printf("\n\n項目的數目\t學校的名字\t分數");
for (i=1;i<=ntsp;i++)
{
for (j=1;j<=pfirst->count;j++)
{
if ( pfirst->athlete[j].item == i )
{
printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;
}
}
}
printf("\n\n\n\t\t\t\t\t\t按任意建 進入下一頁");
getchar();
pfirst = pfirst->next;
}
// clrscr();
printf("\n運動會結果:\n\n學校編號\t男運動員成績\t女運動員成績\t總分");
pfirst = head->next;
while ( pfirst->next != NULL )
{
printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);
pfirst = pfirst->next;
}
printf("\n\n\n\t\t\t\t\t\t\t按任意建結束");
getchar();
}
void create()
{
pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));
pfirst->next = head->next ;
head->next = pfirst ;
pfirst->count = 1;
pfirst->menscore = 0;
pfirst->womenscore = 0;
pfirst->totalscore = 0;
}
void Save()
{FILE *fp;
if((fp = fopen("school.dat","wb"))==NULL)
{printf("can't open school.dat\n");
fclose(fp);
return;
}
fwrite(pfirst,sizeof(SCH),10,fp);
fclose(fp);
printf("文件已經成功保存\n");
}
void main()
{
system("cls");
printf("\n\t\t\t 運動會分數統計\n");
printf("輸入學校數目 (x>= 5):");
scanf("%d",&nsc);
printf("輸入男選手的項目(x<=20):");
scanf("%d",&msp);
printf("輸入女選手項目(<=20):");
scanf("%d",&wsp);
ntsp = msp + wsp;
phead = (int *)calloc(ntsp,sizeof(int));
pafirst = phead;
pasecond = phead;
input();
calculate();
output();
Save();
}
標簽:
源代碼
上傳時間:
2016-12-28
上傳用戶:150501
-
#include "string.h"
#include "ctype.h"
#include "stdio.h"
search(char pd[])
{FILE *fp;
int time=0,i=0,j=0,add[80],k=0,m;
char *ch,
str[900];
m=strlen(pd);
if((fp=fopen("haha.txt","r"))==NULL)
{
printf("Cannot open this file\n");
exit(0);
}
for(;!feof(fp);i++)
{
str[i]=fgetc(fp);
if(tolower(str[i])==tolower(pd[k]))
{k++;
if(k==m)
if(!isalpha(i-m)&&!isalpha((str[i++]=fgetc(fp))))
{
time++;
add[j]=i-m+1;
j++;
k=0;
}
else k=0;
}
}
if(time)
{
printf("The time is:%d\n",time);
printf("The adders is:\n");
for(i=0;i
標簽:
查詢學會少年宮
上傳時間:
2016-12-29
上傳用戶:767483511
-
#include "string.h"
#include "ctype.h"
#include "stdio.h"
search(char pd[])
{FILE *fp;
int time=0,i=0,j=0,add[80],k=0,m;
char *ch,
str[900];
m=strlen(pd);
if((fp=fopen("haha.txt","r"))==NULL)
{
printf("Cannot open this file\n");
exit(0);
}
for(;!feof(fp);i++)
{
str[i]=fgetc(fp);
if(tolower(str[i])==tolower(pd[k]))
{k++;
if(k==m)
if(!isalpha(i-m)&&!isalpha((str[i++]=fgetc(fp))))
{
time++;
add[j]=i-m+1;
j++;
k=0;
}
else k=0;
}
}
if(time)
{
printf("The time is:%d\n",time);
printf("The adders is:\n");
for(i=0;i<j;i++)
printf("%5d",add[i]);
if(i%5==0)
printf("\n");
getch();
fclose(fp);
}
else
printf("Sorry!Cannot find the word(^_^)");
}
main()
{
char pd[10],choose='y';
int flag=1;
while(flag)
{printf("In put the word you want to seqarch:");
scanf("%s",pd);
search(strlwr(pd));
printf("\nWould you want to continue?(Y/N):");
getchar();
scanf("%c",&choose);
if((tolower(choose))=='n')
flag=0;
else flag=1;
}
printf("Thanks for your using!Bye-bye!\n");
getch();
}
標簽:
學生專用
上傳時間:
2016-12-29
上傳用戶:767483511
-
移動通信是通信、電子信息類專業的-f-j主要課程,一直被各高校所重視,但
該課程的覆蓋面廣、內容多,概念理解起來比較抽象。實驗課程作為理論課程的重
要補充,可以很好的彌補書本教學的直觀性不足。目前的移動通信實驗系統大多是
以實驗箱配合PC機的模式,但局限于演示和驗證性的實驗內容教學效果較差,同
時也很難激發學生的學習積極性。
標簽:
移動通信
教學實驗系統
碩士
畢業論文
虛擬
上傳時間:
2017-02-19
上傳用戶:rocket1122
-
Shi J. -Stream of Variation Modeling and Analysis for Multistage Manufacturing Processes-CRC Press (2006)
偏差流經典教材
密歇根大學 史建軍
標簽:
偏差流
經典教材
上傳時間:
2017-02-27
上傳用戶:yiwushanpao
-
/*import java.util.Scanner;
//主類
public class student122 {
//主方法
public static void main(String[] args){
//定義7個元素的字符數組
String[] st = new String[7];
inputSt(st); //調用輸入方法
calculateSt(st); //調用計算方法
outputSt(st); //調用輸出方法
}
//其他方法
//輸入方法
private static void inputSt(String st[]){
System.out.println("輸入學生的信息:");
System.out.println("學號 姓名 成績1,2,3");
//創建鍵盤輸入類
Scanner ss = new Scanner(System.in);
for(int i=0; i<5; i++){
st[i] = ss.next(); //鍵盤輸入1個字符串
}
}
//計算方法
private static void calculateSt(String[] st){
int sum = 0; //總分賦初值
int ave = 0; //平均分賦初值
for(int i=2;i<5;i++) {
/計總分,字符變換成整數后進行計算
sum += Integer.parseInt(st[i]);
}
ave = sum/3; //計算平均分
//整數變換成字符后保存到數組里
st[5] = String.valueOf(sum);
st[6] = String.valueOf(ave);
}
//輸出方法
private static void outputSt(String[] st){
System.out.print("學號 姓名 "); //不換行
System.out.print("成績1 成績2 成績3 ");
System.out.println("總分 平均分");//換行
//輸出學生信息
for(int i=0; i<7; i++){
//按格式輸出,小于6個字符,補充空格
System.out.printf("%6s", st[i]);
}
System.out.println(); //輸出換行
}
}*/
import java.util.Scanner;
public class student122 {
public static void main(String[] args) {
// TODO 自動生成的方法存根
String[][] st = new String[3][8];
inputSt(st);
calculateSt(st);
outputSt(st);
}
//輸入方法
private static void inputSt(String st[][])
{
System.out.println("輸入學生信息:");
System.out.println("班級 學號 姓名 成績:數學 物理 化學");
//創建鍵盤輸入類
Scanner ss = new Scanner(System.in);
for(int j = 0; j < 3; j++)
{
for(int i = 0; i < 6; i++)
{
st[j][i] = ss.next();
}
}
}
//輸出方法
private static void outputSt(String st[][])
{
System.out.println("序號 班級 學號 姓名 成績:數學 物理 化學 總分 平均分");
//輸出學生信息
for(int j = 0; j < 3; j++)
{
System.out.print(j+1 + ":");
for(int i = 0; i < 8; i++)
{
System.out.printf("%6s", st[j][i]);
}
System.out.println();
}
}
//計算方法
private static void calculateSt(String[][] st)
{
int sum1 = 0;
int sum2 = 0;
int sum3 = 0;
int ave1 = 0;
int ave2 = 0;
int ave3 = 0;
for(int i = 3; i < 6; i++)
{
sum1 += Integer.parseInt(st[0][i]);
}
ave1 = sum1/3;
for(int i = 3; i < 6; i++)
{
sum2 += Integer.parseInt(st[1][i]);
}
ave2 = sum2/3;
for(int i = 3; i < 6; i++)
{
sum3 += Integer.parseInt(st[2][i]);
}
ave3 = sum3/3;
st[0][6] = String.valueOf(sum1);
st[1][6] = String.valueOf(sum2);
st[2][6] = String.valueOf(sum3);
st[0][7] = String.valueOf(ave1);
st[1][7] = String.valueOf(ave2);
st[2][7] = String.valueOf(ave3);
}
}
標簽:
java
數據庫
上傳時間:
2017-03-17
上傳用戶:simple
-
1.Describe a Θ(n lg n)-time algorithm that, given a set S of n integers and
another integer x, determines whether or not there exist two elements in S whose sum is exactly x. (Implement exercise 2.3-7.)
#include<stdio.h>
#include<stdlib.h>
void merge(int arr[],int low,int mid,int high){
int i,k;
int *tmp=(int*)malloc((high-low+1)*sizeof(int));
int left_low=low;
int left_high=mid;
int right_low=mid+1;
int right_high=high;
for(k=0;left_low<=left_high&&right_low<=right_high;k++)
{
if(arr[left_low]<=arr[right_low]){
tmp[k]=arr[left_low++];
}
else{
tmp[k]=arr[right_low++];
}
}
if(left_low<=left_high){
for(i=left_low;i<=left_high;i++){
tmp[k++]=arr[i];
}
}
if(right_low<=right_high){
for(i=right_low;i<=right_high;i++)
tmp[k++]=arr[i];
}
for(i=0;i<high-low+1;i++)
arr[low+i]=tmp[i];
}
void merge_sort(int a[],int p,int r){
int q;
if(p<r){
q=(p+r)/2;
merge_sort(a,p,q);
merge_sort(a,q+1,r);
merge(a,p,q,r);
}
}
int main(){
int a[8]={3,5,8,6,4,1,1};
int i,j;
int x=10;
merge_sort(a,0,6);
printf("after Merging-Sort:\n");
for(i=0;i<7;i++){
printf("%d",a[i]);
}
printf("\n");
i=0;j=6;
do{
if(a[i]+a[j]==x){
printf("exist");
break;
}
if(a[i]+a[j]>x)
j--;
if(a[i]+a[j]<x)
i++;
}while(i<=j);
if(i>j)
printf("not exist");
system("pause");
return 0;
}
標簽:
c語言
算法
排序
上傳時間:
2017-04-01
上傳用戶:糖兒水嘻嘻
-
STM32 入門教程系列之二:如何安裝J-link驅動軟件
標簽:
STM
32
入門教程
上傳時間:
2017-04-17
上傳用戶:Takumi_wake