Problème avec programmation d'un tableau
Bonjour a tous,
j'ai une petite problème avec ce programme
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <limits>
#include <stdlib.h>
using namespace std;
double Y[200][200][10];
int main()
{
int Nx=200;
int Nt=10;
int Ny=200;
double x,y,z,c;
double stepx=0.01;
double stepy=0.01;
double stept=0.1;
for(int t=0;t<Nt;t++)
{
for(int i=0;i<Nx;i++)
{
for(int j=0;j<Ny;j++)
{
x=-1+i*stepx;
y=-1+j*stepy;
z=t*stept;
Y[i][j][t]=x-y;
if(Y[i][j][t]=0.0)
{
cout<<x<<" "<<endl;}
}
}
}
return 0;
} |
je ne comprend pas pourquoi il ne m'affiche rien or le Y=0 pour x=y
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <limits>
#include <stdlib.h>
using namespace std;
double Y[200][200][10];
int main()
{
int Nx=200;
int Nt=10;
int Ny=200;
double x,y,z,c;
double stepx=0.01;
double stepy=0.01;
double stept=0.1;
for(int t=0;t<Nt;t++)
{
for(int i=0;i<Nx;i++)
{
for(int j=0;j<Ny;j++)
{x=-1+i*stepx;
y=-1+j*stepy;
z=t*stept;
Y[i][j][t]=x-y;
if(x=y)
{cout<<x<<" "<<endl;}
}
}
}
return 0;
} |
Merci d'avance