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 48 49 50 51 52 53 54 55 56 57
| #include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int fonction_affine(int a, int b, int u, int v)
{
puts("Veuillez entrer a");
scanf("%d",&a);
puts("Veuillez entrer b");
scanf("%d",&b);
puts("Veuillez entrer u");
scanf("%d",&u);
v = a * u + b;
printf("L'image de u par la fonction affine f est %d\n",v);
system("PAUSE");
return 0;
}
int fonction_carre(int z, int w)
{
int x,y;
puts("Veuillez entrer un nombre");
scanf("%d",&z);
w = z * z;
printf("L'image de z par la fonction carré est %d\n",w);
system("PAUSE");
return 0;
}
int fonction_inverse(int x, int y)
{
puts("Veuillez entrer x");
scanf("%d", &x);
y = 1 / x;
printf("L'image de x par la fonction inverse est %d\n",y);
system("PAUSE");
return 0;
}
int main()
{
puts("Tapez F1 pour fonction affine, F2 pour fonction carre, F3 pour fonction inverse");
if((keybd_event(VK_F1,0,0,0))&&(keybd_event(VK_F1,0,KEYEVENTF_KEYUP,0)))
{
fonction_affine;
}
if((keybd_event(VK_F2,0,0,0))&&(keybd_event(VK_F2,0,KEYEVENTF_KEYUP,0)))
{
fonction_carre;
}
if((keybd_event(VK_F3,0,0,0))&&(keybd_event(VK_F3,0,KEYEVENTF_KEYUP,0)))
{
fonction_inverse;
}
return 0;
} |
Partager