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
|
#include <iostream>
#include <math.h>
double intpart(double x)
{
double intpart, fractpart;
fractpart=modf(x, &intpart);
return intpart;
}
int main()
{
double x,y, k;
std::cout<<"Entrez x:"<<std::endl;
std::cin>>x;
std::cout<<"Entrez y:"<<std::endl;
std::cin>>y;
k=(1-y)/(2*y);
std::cout<<"La partie entier de k est: "<<intpart(k)<<std::endl;
if(x<0)
{
if((double)intpart(k)==k)
std::cout<<"Procédure1"<<std::endl ;
else
std::cout<<"Procédure2"<<std::endl;
}
char rep;
std::cin>>rep;
return 0;
} |
Partager