-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalgo.cpp
More file actions
38 lines (38 loc) · 734 Bytes
/
algo.cpp
File metadata and controls
38 lines (38 loc) · 734 Bytes
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
#include <stdio.h>
#include <string.h>
int main()
{
char sentence[101],line[100],word[100],type[100];
char input [11][101];
int i,j=0,k=0,count=0;
scanf("%[^\n]",sentence);
// printf("%s\n",sentence);
for(i=0;i<strlen(sentence);i++)
{
if(sentence[i]!=' ' && sentence[i]!='.' && sentence[i]!='\0')
{
input[j][k]=sentence[i];
k++;
}
else if(sentence[i]==' ' || sentence[i]=='.')
{
input[j][k]='\0';
k=0;
j++;
count++;
}
}
FILE *fp;
fp = fopen("data.txt","r");
if(fp==NULL)
{
printf("File doesn't exist!\n");
return 1;
}
while(fgets(line,100,fp)!=NULL)
{
sscanf(line,"%s %s",word,type);
//tinggal compare cari katanya di kbbi guys
}
return 0;
}