-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path1140.c
50 lines (38 loc) · 770 Bytes
/
1140.c
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
//1140 - Flores Florescem da França
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
int main()
{
char str[1050], compara[2], resultado[2];
int c;
fgets( str, 1050, stdin );
do
{
for (c=0; c < strlen(str); c++)
str[c]=tolower(str[c]);
compara[0] = str[0];
resultado[0] = 'Y';
for (c=0; c < strlen(str); c++)
{
if (str[c] == ' ')
{
if(compara[0] != str[c+1])
{
resultado[0] = 'N';
}
else
{
if (resultado[0] != 'N')
resultado[0] = 'Y';
}
}
}
printf("%c\n", resultado[0]);
fgets( str, 1050, stdin );
}
while (str[0] != '*' || str[0] == ' ' || str[c] == ' ' || str[c] == ' ');
return 0;
}