A voir également:
- Algorithme
- Logiciel algorithme euromillion - Télécharger - Loisirs créatifs
- Logiciel algorithme gratuit - Télécharger - Édition & Programmation
- Algorithme euromillion excel gratuit - Forum Algorithmes / Méthodes
- Algorithme ajout rapide snapchat - Forum Snapchat
- Ajout rapide snap - Forum Snapchat
1 réponse
Théoriquement de tête et selon mes calculs ca devrait te donner un tableau comme ça :
-2__6__4
1__2__1
6__7__3
Mais je ne suis pas sur , je t'écris le programme en C++, test-le :
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int tab[3][3];
int i,j,val;
val=-4;
for(i=0,i<3,i++)
{
for(j=0,j<3,j++)
{
if(i<=j)
{
val+=2;
tab[i][j]=j*j+val;
}
else
{
val-=3;
tab[i][j]=i*i+val;
}
}
}
for(i=0,i<3,i++)
{
for(j=0,j<3,j++)
{
cout<<tab[i][j];
}
}
return 0;
}
-2__6__4
1__2__1
6__7__3
Mais je ne suis pas sur , je t'écris le programme en C++, test-le :
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int tab[3][3];
int i,j,val;
val=-4;
for(i=0,i<3,i++)
{
for(j=0,j<3,j++)
{
if(i<=j)
{
val+=2;
tab[i][j]=j*j+val;
}
else
{
val-=3;
tab[i][j]=i*i+val;
}
}
}
for(i=0,i<3,i++)
{
for(j=0,j<3,j++)
{
cout<<tab[i][j];
}
}
return 0;
}