源程式:
//
// main.cpp
// p292
//
// Created by duanqibo on 2020/1/27.
// Copyright © 2020年 duanqibo. All rights reserved.
//
#include<iostream>
using namespace std;
int main()
{
int n=0;
char ch;
while((ch=cin.get())!=EOF) //當檔案沒有結束時繼續進行循環
{
cout.put(ch);
n++;
}
cout<<"輸入字元共計:"<<n<<endl;
system("pause");
return 0;
}