TP7: formattage

This commit is contained in:
2024-11-28 13:48:19 +01:00
parent 456150e6b1
commit 0a54ea3aca
3 changed files with 28 additions and 2 deletions

View File

@@ -1,9 +1,21 @@
#pragma once
#include <fstream>
#include <iomanip>
#include <iostream>
using namespace std;
void getfloat(ifstream& s, float& f, const char sep);
void getint(ifstream& s, int& f, const char sep);
template <class T>
void format(T t, int w) {
cout << left << setw(w) << t << " ";
}
template <class T>
void format(T t) {
format(t, 4);
}