编制程序,统计文本stdin中字符$出现的次数,并将结果写入文件stdout
字符文本
$次数
as$dfkjhkjkjdhf asdfkj$lskdfj werijweirjo$wie \n \n \n
as$dfkjhkjkjdhf asdfkj$lskdfj werijweirjo$wie
\n \n \n
3 \n
3
\n
#include <stdio.h> int main(){ FILE *p; ..... //p=fopen("data.txt","r"); p=stdin; ..... //p=fopen("res.txt","w"); p=stdout; .... return 0; }