#include <stdio.h>
int main(void) {
float cr[] = {100, 200, 300, 400};
float rr[] = {0, 400, 800, 1200};
float i, vo, vol = 0;
int r, c;
float kr;
for( r = 0; r < 4; r++) {
for (c = 0; c < 4; c++ ) {
kr = rr[r]+cr[c];
i = 5.0/(1000.0+kr);
vo = 1000.0*i;
printf("R %d:C %d, %f, (%f)\n", r
, c
, vo
, vo
/(5.0/1023.0)); printf(" delta %fV (%f)\n", vol
-vo
, (vol
-vo
)/(5.0/1023.0)); vol = vo;
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgCiAgZmxvYXQgY3JbXSA9IHsxMDAsIDIwMCwgMzAwLCA0MDB9OwogIGZsb2F0IHJyW10gPSB7MCwgNDAwLCA4MDAsIDEyMDB9OwogIAogIGZsb2F0IGksIHZvLCB2b2wgPSAwOwogIGludCByLCBjOwogIGZsb2F0IGtyOwogIAogIGZvciggciA9IDA7IHIgPCA0OyByKyspIHsKICAgIGZvciAoYyA9IDA7IGMgPCA0OyBjKysgKSB7CiAgICAgIGtyID0gcnJbcl0rY3JbY107CiAgICAgIAogICAgICBpID0gNS4wLygxMDAwLjAra3IpOwogICAgICB2byA9IDEwMDAuMCppOwogICAgICBwcmludGYoIlIgJWQ6QyAlZCwgICVmLCAoJWYpXG4iLCByLCBjLCB2bywgdm8vKDUuMC8xMDIzLjApKTsKICAgICAgcHJpbnRmKCIgICAgICAgICAgICAgICAgICAgICBkZWx0YSAlZlYgKCVmKVxuIiwgdm9sLXZvLCAodm9sLXZvKS8oNS4wLzEwMjMuMCkpOwogICAgICB2b2wgPSB2bzsKICAgIH0gICAgCiAgfQogIAogIAogIAogIHJldHVybiAwOwp9Cg==
R 0:C 0, 4.545454, (929.999971)
delta -4.545455V (-929.999991)
R 0:C 1, 4.166667, (852.500044)
delta 0.378788V (77.499926)
R 0:C 2, 3.846154, (786.923078)
delta 0.320513V (65.577011)
R 0:C 3, 3.571429, (730.714290)
delta 0.274725V (56.208776)
R 1:C 0, 3.333333, (682.000017)
delta 0.238095V (48.714246)
R 1:C 1, 3.125000, (639.375010)
delta 0.208333V (42.625033)
R 1:C 2, 2.941177, (601.764718)
delta 0.183824V (37.610306)
R 1:C 3, 2.777778, (568.333347)
delta 0.163399V (33.431334)
R 2:C 0, 2.631579, (538.421076)
delta 0.146199V (29.912264)
R 2:C 1, 2.500000, (511.499989)
delta 0.131579V (26.921096)
R 2:C 2, 2.380952, (487.142876)
delta 0.119048V (24.357148)
R 2:C 3, 2.272727, (464.999985)
delta 0.108225V (22.142857)
R 3:C 0, 2.173913, (444.782588)
delta 0.098814V (20.217395)
R 3:C 1, 2.083333, (426.250022)
delta 0.090580V (18.532568)
R 3:C 2, 2.000000, (409.200019)
delta 0.083333V (17.050033)
R 3:C 3, 1.923077, (393.461539)
delta 0.076923V (15.738473)