#include <string.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <windows.h>
int main(void)
{
// clrscr();
system("cls");
MessageBox(NULL,"KAMUS TRANSLATE 3 BAHASA","KAMUS 600 MILIYAR",MB_ICONINFORMATION | MB_OK);
system("color B"); //beri warna tulisan
FILE *its;
FILE *itc;
char msg[1000][15];
char ind[15];
char jer[1000][15];
int a,b,c,dummy=1;
if((its = fopen("DATA.CUK", "r"))==NULL)
{
printf("ERROR!!! file DATA.CUK corrupt");
getch();
exit(1);
}
while(dummy > 0){
puts("Tentukan arah translate: ");
puts("1. Indonesia-English");
puts("2. English-Indonesia");
puts("3. Indonesia-Jerman");
puts("4. Jerman-Indonesia");
puts("\n\n");
puts("5.exit");
b=getch();
switch(b)
{
case '1' :
{
//clrscr();
system("cls");
for(a=1;a<=1000;a++)
fgets(msg[a], sizeof(msg),its);
printf("Indonesia : ");
gets(ind);
strcat(ind,"\n");
printf("English : ");
for(a=1;a<=1000;a++)
if(strcmp(ind,msg[a])==0)
printf("%s", msg[a+1]);
fclose(its);
getch();
break;
}
case '2' :
{
//clrscr();
system("cls");
for(a=1;a<=1000;a++)
fgets(msg[a], sizeof(msg),its);
printf("English : ");
gets(ind);
strcat(ind,"\n");
printf("Indonesia : ");
for(a=1;a<=1000;a++)
if(strcmp(ind,msg[a])==0)
printf("%s", msg[a-1]);
fclose(its);
getch();
break;
}
case '3' :
{
//clrscr();
system("cls");
if((itc = fopen("Data jerman.CUK", "r"))==NULL)
system("cls");
for(c=1;c<=1000;c++)
fgets(jer[c], sizeof(jer),itc);
printf("Indonesia : ");
gets(ind);
strcat(ind,"\n");
printf("Jerman : ");
for(c=1;c<=1000;c++)
if(strcmp(ind,jer[c])==0)
printf("%s", jer[c+1]);
fclose(itc);
getch();
break;
}
case '4' :
{
//clrscr();
system("cls");
if((itc = fopen("Data jerman.CUK", "r"))==NULL)
system("cls");
for(c=1;c<=1000;c++)
fgets(jer[c], sizeof(ind),itc);
printf("Jerman : ");
gets(ind);
strcat(jer[c],"\n");
printf("Indonesia : ");
for(c=1;c<=1000;c++)
if(strcmp(jer[c],ind)==0)
printf("%s", jer[c-1]);
fclose(itc);
getch();
break;
}
case '5':
{
dummy = -1;
}
}
}
// dummy
return 0;
}
Wednesday, December 21, 2011
5:24 PM
Kamus
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment