Le 24 mars, 2009 # include
typedef enum (dim., lun., mar., mer., jeu., ven., sam.) jours;
int main ()
(
Numéro de jour;
printf ( "S'il vous plaît, entrez le numéro du jour de la week.n");
scanf ( "% d", & nombre);
switch (nombre)
(
case 0: printf ( "le jour est Sunday.n"); break;
case 1: printf ( "le jour est Monday.n"); break;
case 2: printf ( "le jour est Tuesday.n"); break;
case 3: printf ( "le jour est Wednesday.n"); break;
case 4: printf ( "le jour est thursday.n"); break;
case 5: printf ( "le jour est Friday.n"); break;
cas 6: printf ( "le jour est saturday.n"); break;
)
return 0;
)
Posté dans C | Aucun commentaire »
23 mars, 2009 Fonction SetBytes (Bytes) As String
On Error GoTo ErrorHandler
Si Octets> = 1073741824 Puis
SetBytes = Format (Octets / 1024 / 1024 / 1024, "# 0.00") _
& "GB"
ElseIf Octets> = 1048576 Ensuite
SetBytes = Format (Bytes / 1024 / 1024, "# 0.00") & "MB"
ElseIf Octets> = 1024 alors
SetBytes = Format (Bytes / 1024, "# 0.00") & "KB"
ElseIf Octets <1024 alors
SetBytes = Fix (Bytes) & "Bytes"
End If
Exit Function
ErrorHandler:
SetBytes = "ne peut pas calculer"
End Function
Private Sub Form_Load ()
MsgBox SetBytes (1100)
End Sub
Posted in Visual Basic | Aucun commentaire »
22 mars 2009 # include
# include
dict char [] [2] [40] = (
"Bonjour", "bonjour",
"Year", "annee",
"Bonne", "bon",
"Voiture", "voiture",
"Maison", "maison",
"Oui", "oui",
"Ami", "ami",
"Route", "rue",
"",""
);
int main (void)
(
int i = 0;
char mot [80];
printf ( "Entrez un mot en anglais à la recherche for.n");
gets (mot);
while (strcmp (dict [i] [0 ],""))
(
if (! strcmp (mot, dict [i] [0]))
(
printf ( "équivalent français est:% sn", dict [i] [1]);
break;
)
i + +;
)
if (! strcmp (dict [i] [0], ""))
printf ( "pas found.n Word");
return 0;
)
Posté dans C | Aucun commentaire »
22 mars 2009 Declare Function SystemParametersInfo Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam Comme Tout, ByVal fuWinIni As Long) As Long
Public Const SPI_SETDESKWALLPAPER = 20
Dim lngSuccess As Long
Dim strBitmapImage As String
strBitmapImage = "h: windowsstraw.bmp"
lngSuccess = SystemParametersInfo (SPI_SETDESKWALLPAPER, 0, strBitmapImage, 0)
Posted in Visual Basic | Aucun commentaire »
Le 21 mars, 2009 # include
# include
# define WIN32_LEAN_AND_MEAN
int WINAPI WinMain (HINSTANCE HINSTANCE, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
(
if (MessageBox (NULL, "Appuyez sur OK pour vider le dossier des documents récents.", "recyclage", MB_YESNO | MB_ICONINFORMATION)! = IDYES)
return FALSE;
SHAddToRecentDocs (SHARD_PATH, NULL);
return FALSE;
)
Posté dans C | Aucun commentaire »