1
~cpp
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream fin("input.txt");
int number;
int floor;
int people = 0;
int in;
int out;
fin >> number;
cout << number << " ." << endl;
while(fin >> floor >> in >> out)
{
people = people + in - out;
cout << " " << floor << " " << endl
<< in << " " << out << " " << endl
<< people << " " << endl
<< "**************************************************" << endl;
}
return 0;
}
?~cpp
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream fin("input.txt");
int number;
int floor;
int people = 0;
int in;
int out;
int temp = 1;
fin >> number;
cout << number << " ." << endl;
while(fin >> floor >> in >> out)
{
if(temp < floor)
{
while(temp+1 != floor)
{
temp++;
cout << " " << temp << " " << endl
<< "**************************************************" << endl;
}
temp++;
}
else if(temp > floor)
{
while(temp-1 != floor)
{
temp--;
cout << " " << temp << " " << endl
<< "**************************************************" << endl;
}
}
people = people + in - out;
cout << " " << floor << " " << endl
<< in << " " << out << " " << endl
<< people << " " << endl;
if(people > 10)
{
cout << "\a." << endl
<< people - 10 << " ." <<endl;
people = 10;
}
cout << "**************************************************" << endl;
}
return 0;
}










