Created
September 17, 2011 14:29
-
-
Save mactkg/1223985 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<math.h> | |
#include<stdio.h> | |
void main(){ | |
int i,times; | |
float vo,vi; | |
printf("please input Vi\n"); | |
scanf("%f", &vi); | |
times = 1; | |
for(i = 0; i < 4; i++) { | |
times = times*10; | |
printf("3*%d:",times); | |
scanf("%f", &vo); | |
printf("result:%lf\n\n", 20*log10((double)vo/vi)); | |
printf("5*%d:",times); | |
scanf("%f", &vo); | |
printf("result:%lf\n\n", 20*log10((double)vo/vi)); | |
printf("7*%d:",times); | |
scanf("%f", &vo); | |
printf("result:%lf\n\n", 20*log10((double)vo/vi)); | |
printf("10*%d:",times); | |
scanf("%f", &vo); | |
printf("result:%lf\n\n", 20*log10((double)vo/vi)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment