#include <iostream> #include <string> using namespace std; int f(string s){ int res = 0, i, j; for(i = 0; i < s.size(); i++){ if(s[i] == '.'){ j = i; while(s[j] == '.'){ j++; } res += j - i - 1; i = j; } } return res; } int main(){ int length, times, position, i; char replace_ch; string s; while(cin >> length >> times >> s){ for(i = 0; i < times; i++){ cin >> position >> replace_ch; s[position - 1] = replace_ch; cout << f(s) << endl;; } } }
点赞 评论

相关推荐

点赞 评论 收藏
分享
05-14 20:34
门头沟学院 Java
窝补药贝八股:管他们,乱说,反正又不去,直接说680
点赞 评论 收藏
分享
牛客网
牛客企业服务