All pastes #2054532 Raw Edit

Miscellany

public text v1 · immutable
#2054532 ·published 2011-05-06 12:15 UTC
rendered paste body
#include<windows.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<stdio.h>
#include<conio.h>
 int main()
	{
	char taste[4][10],tasta='1';
	strcpy(taste[0],"zxcvbnm,./");
	strcpy(taste[1],"asdfghjkl;");
	strcpy(taste[2],"qwertyuiop");
	strcpy(taste[3],"1234567890");
	double nota,x;
	int i,j,n,ok;
	while(tasta!='0')
	{ok=0;
		for(i=0;i<=3&&ok==0;i++)
			for(j=0;j<=9&&ok==0;j++)
				if(tasta==taste[i][j])
					{
						ok=1;
						n=i*5+j;
				}
	x=pow(2,n*1.0/12);
	nota=164.82*4*x;
	for(i=0;i<=10;i++)
		Beep(nota+pow(2,i),1);
	tasta=getch();
	}
	return 0;
}