如何用switch写出替换,并报告次数。

题目:使用 switch语句编写一个程序读取输入,读到#结束,用感叹号替换句号,用两个感叹号替换原来的感叹号,最后报告替换多少次替换。
我的问题是如何用switch写出替换,并报告次数。
我的代码

 #include <stdio.h>

    int main (void) {
char ch;
scanf("%c",&ch);
    while((ch =getchar())!='#')
{
    switch(ch){
        case '!' :
            printf("!!\n");
            break;
        case ',':
            printf("!\n");
            break;
    }
    return 0;
}
}

后面就没有思路了(>﹏<),求解答,谢谢

#include <stdio.h>
int main () {
    int cnt=0;
    char ch;
    while((ch=getchar())!='#') {
        switch(ch) {
            case '!' :
                cnt++;
                printf("!!");
                break;
            case ',':
                cnt++;
                printf("!");
                break;
            default:
                printf("%c",ch);
                break;
        }
        
    }
    printf("\n%d次替换",cnt);
    return 0;
}