-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathEDIT.cpp
More file actions
34 lines (32 loc) · 1.27 KB
/
EDIT.cpp
File metadata and controls
34 lines (32 loc) · 1.27 KB
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
#include<stdio.h>
int main()
{
char a[100000];
int i,j,count1,count2;
while(scanf("%s",a) != EOF)
{
count1=0;
count2=0;
for(j=0;a[j]!='\0';j++)
{
if(j%2==0)
{
if(a[j]<=91)
count1++;
else
count2++;
}
if(j%2!=0)
{
if(a[j]<=91)
count2++;
else
count1++;
}
}
if(count1<count2)
printf("%d\n",count1);
else
printf("%d\n",count2);
}
}