1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <iomanip>
#include <iostream>
#include <cmath>
using namespace std;
double calc_volts(double, double, double);
int main()
{
const int maxnum1 = 10;
int i, double current[maxnum1] = {10.62,14.89,13.21,16.55,19.62,9.47,6.58,18.32,12.15,3.98};
int j, double volts[maxnum1];
int k, double resistance[maxnum1] = {4,8.5,6,7.35,9,15.3,3,5.4,2.9,4.8};
for (i=0, i<maxnum1, i++)
for (j=0, j<maxnum1 , j++)
volts[j] = calc_volts(current, volts, resistance, maxnum1);
}
double calc_volts(double current[i],double volts[j], double resistance[k])
{double volts;
volts[j] = current[i]*resistance[k];
return volts;
}
|