kadreg profil: Utilisateur | J'ai pêté un plomb
Code :
- #include <iostream>
- const int NB=24;
- template<char C, int N>
- class Afficher : Afficher<C, N-1> {
- public:
- Afficher () {
- std::cout<<C;
- }
- };
- template <char C>
- class Afficher<C, 0> {
- public:
- Afficher () {}
- };
- template <int T, int U=0>
- class StarLine : public StarLine<T, U+1> {
- public:
- StarLine () {
- Afficher<' ', U> a;
- Afficher<'*', 1+((T-U)*2)> b;
- std::cout<<std::endl;
- }
- };
- template <>
- class StarLine <NB, NB+1>{
- public:
- StarLine() {}
- };
- int main () {
- StarLine<NB> line;
- return 0;
- }
|
---------------
brisez les rêves des gens, il en restera toujours quelque chose... -- laissez moi troller sur discu !
|