Untitled
unknown
plain_text
3 years ago
439 B
6
Indexable
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
float f(float a) {
return a * 2 - 4 * a;
}
float y(float b) {
return -8*b + 4;
}
float g(float a, float b) {
return f(a) * a - y(b) * b;
}
int main() {
ifstream in("func.txt");
ofstream out("result.txt");
float a, b;
int c;
in >> c;
for (int i = 0; i < c; i++){
in >> a >> b;
out << g(a, b) << '\n';
}
}Editor is loading...