Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char ok1;
- char ok2;
- char ok3;
- int lenth=0, i, sum=0, numli=0, numilli=0;
- while ((ok1=getchar()) !='@')
- {
- if ((ok1>='1')&&(ok1<='9'))
- {
- ok2=getchar();
- ok3=ok2;
- numli++;
- lenth=ok1-'0';
- for (i=0;i<lenth-1;i++)
- {
- ok2=getchar();
- if((ok2>='A')&&(ok2<='Z'))
- {
- if(ok2==ok3+1)
- {
- numli++;
- }
- else {numli-=(i+1);
- numilli+=(i+2);
- break;}
- }
- else {numli-=(i+1);
- numilli+=(i+1);
- break;}
- ok3=ok2;
- }
- if (i==(ok1-'0'-1))
- {
- sum++;
- }}
- else numilli++;
- }
- printf("%d\n%d\n%d\n", sum,numli,numilli);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement