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 32 33 34 35 36
|
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
void Read (int & a, int & b, int & x);
void Print (int a, int b, int x);
int main()
{
setlocale(LC_ALL, "Lithuanian");
int a, b, x;
Read (a, b, x);
Print (a, b, x);
return 0;
}
void Read (int & a, int & b, int & x)
{
ifstream fd ("staciakampis_data.txt");
fd >> a >> b >> x;
}
void Print (int a, int b, int x)
{
ofstream fr ("staciakampis_res.txt");
for (int i=0; i < 1; i++)
{
if (a + x <= b)
{
fr << a++ << " " << a++ + x;
}
else if (b + x <= a)
{
fr << b << " " << b + x;
}
}
}
|