24 mars 2009 # include
typedef enum (man, tirs, ons, tor, fre, lør) dager;
int main ()
(
dager tallet;
printf ( "Skriv inn nummeret på dagen i week.n");
scanf ( "% d", & tall);
bryteren (tall)
(
case 0: printf ( "dagen er Sunday.n"); break;
case 1: printf ( "dagen er Monday.n"); break;
case 2: printf ( "dagen er Tuesday.n"); break;
case 3: printf ( "dagen er Wednesday.n"); break;
case 4: printf ( "dagen er thursday.n"); break;
case 5: printf ( "dagen er Friday.n"); break;
case 6: printf ( "dagen er saturday.n"); break;
)
return 0;
)
Posted in C | No Comments »
23 mars 2009 Funksjon SetBytes (byte) As String
On Error Goto errorhandler
Hvis Bytes> = 1073741824 Deretter
SetBytes = Format (Byte / 1024 / 1024 / 1024, "# 0,00") _
& "GB"
ElseIf Bytes> = 1048576 Deretter
SetBytes = Format (Byte / 1024 / 1024, "# 0,00") & "MB"
ElseIf Bytes> = 1024 Then
SetBytes = Format (Byte / 1024, "# 0,00") & "KB"
ElseIf Bytes <1024 Then
SetBytes = Fix (Bytes) & "byte"
End if
Avslutt Funksjon
errorhandler:
SetBytes = "kan ikke regne"
End Function
Private Sub Form_Load ()
MsgBox SetBytes (1100)
End Sub
Skrevet i Visual Basic | No Comments »
22 mars 2009 # include
# include
char dict [] [2] [40] = (
"Hei", "Bonjour",
"År", "annee"
"God", "bon",
"Bil", "voiture"
"Huset", "maison",
"Ja", "Oui",
"Venn", "AMI,
"Road", "rue"
"",""
);
int main (void)
(
int i = 0;
char ordet [80];
printf ( "Skriv et ord på engelsk for å søke for.n");
gets (word);
while (strcmp (dict [i] [0 ],""))
(
if (! strcmp (Word, dict [i] [0]))
(
printf ( "French tilsvarende er:% sn" dict [i] [1]);
break;
)
i + +;
)
if (! strcmp (dict [i] [0], ""))
printf ( "Word ikke found.n");
return 0;
)
Posted in C | No Comments »
22 mars 2009 Erklærer Funksjon SystemParametersInfo Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam som noen, ByVal fuWinIni As Long) As Long
Offentlig const SPI_SETDESKWALLPAPER = 20
Dim lngSuccess så lenge
Dim strBitmapImage As String
strBitmapImage = "H: windowsstraw.bmp"
lngSuccess = SystemParametersInfo (SPI_SETDESKWALLPAPER, 0, strBitmapImage, 0)
Skrevet i Visual Basic | No Comments »
21 mars 2009 # include
# include
# define WIN32_LEAN_AND_MEAN
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
(
if (MessageBox (NULL, "Trykk OK for å tømme Nylig dokumenter mappe.", "recycler", MB_YESNO | MB_ICONINFORMATION)! = IDYES)
return false;
SHAddToRecentDocs (SHARD_PATH, NULL);
return false;
)
Posted in C | No Comments »