Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char** argv)
- {
- unsigned long int count = 0;
- char c;
- while((c=getchar())!= EOF){
- if(c=='('){
- int len;
- scanf("%d", &len);
- getchar();//discard x
- int i;
- scanf("%d", &i);
- getchar();//discard )
- for(;len>0;len--){
- getchar();
- count += i;
- }
- }else{count++;}
- }
- printf("%lu", count-1);//eof still isn't a character
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment