首页 > 代码库 > todo
todo
1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <iostream> 5 #include <algorithm> 6 #define ll long long 7 using namespace std; 8 const int INF = 0x3f3f3f3f; 9 10 char num[2123456];11 int main(){12 int n, i, j, m;13 ll ans;14 bool k, d;15 int k_num, d_num;16 while(EOF != scanf("%d",&n)){17 memset(num, 0, sizeof(num));18 ans = d_num = 1;19 k = d = false;20 for(i = 0; i < n; ++i) gets(num + strlen(num));21 for(i = 0; num[i] != 0; ++i){22 char cur = num[i];23 if(cur == ‘{‘){24 k_num = 1;25 k = true;26 }27 if(cur == ‘}‘){28 ans *= k_num;29 k = false;30 }31 if(k){32 if(cur == ‘|‘) ++k_num;33 }34 if(d && cur != ‘ ‘ && i > 0 && num[i-1] == ‘ ‘){35 ans *= d_num;36 d_num = 1;37 }38 if(cur == ‘$‘){39 d_num = 1;40 d = !d;41 }42 if(d && cur == ‘ ‘){43 ++d_num;44 }45 if(ans > 100000)46 break;47 }48 if(ans > 100000) printf("doge\n");49 else printf("%I64d\n",ans);50 }51 return 0;52 }
http://blog.csdn.net/u013532224/article/details/38275551
http://www.cnblogs.com/zyue/p/3876616.html
http://blog.csdn.net/ljsspace/article/details/6431544
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。