Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
425 B
0
Indexable
Never
#include <iostream>
#include "windows.h"
#include <fstream>
using namespace std;
void foo(float *mas,float *ass) {
	for (int i = 0; i < 100; i++){
		*mas = sin(0.001 * i);
		mas++;
		*ass = i * 0.001;
		ass++;
	}
}
int main() {
	ofstream out("result.txt");
	float mas[100];
	float ass[100];
	foo(mas,ass);
	for (int i = 0; i < 100; i++)
	{
		out << "X = " << ass[i] << "sin(X) = " << mas[i] << '\n';
	}
}