//main
#include <iostream>
#include <cstdlib>
using namespace std;
#include "libro.h"
int main()
{
test ab;
cout<<"enter width limit";
int length;
cin>>length;
ab.alternate(length);
}
//implementation
#include <iostream>
#include <cctype>
#include <cstdlib>
using namespace std;
#include "libro.h"
int test::alternate(int width)
{
//for odd, 3 char-ellipsis
if(width%2==1)
{
keep=width-3;
}
//for even, 4 char-ellipsis
else if(width%2==0)
{
keep=width-4;
}
return keep_per_end=keep/2;
}
//interface
#ifndef LIBRO_H_INCLUDED
#define LIBRO_H_INCLUDED
#include <iostream>
using namespace std;
class test
{
public:
//check if even or odd
int alternate(int width);
int keep_per_end;
int keep;
};
#endif // LIBRO_H_INCLUDED