#include <fstream>
#include <iostream>
#include <string>

void printSize(const std::string& address) {
  std::fstream motd(address.c_str(), std::ios::binary|std::ios::in|std::ios::ate);
  if(motd) {
    std::fstream::pos_type size = motd.tellg();
    std::cout << address << " " << size << "\n";
  } else {
    perror(address.c_str());
  }
}

int main () {
    printSize("/etc/motd");
    printSize("/etc/passwd");
}
