程序代码:
#include
#include
using
namespace
std;
void
main()
{
char
ch;
int
i=0,j=0,k=0;
ifstream
file("C:/test.txt");//读取c盘的文本文件
cout<<"文本中的内容:";
while(file.get(ch))//读取文本中的内容
{
cout
<<
ch;
if(ch>='0'&&ch<='9')
i++;
else
if(ch>='a'&&ch<='z')
j++;
else
if(ch>='A'&&ch<='Z')
k++;
}
file.close();
//关闭文件流
cout<
追问:
这个是用Java写的吗?好像不对
评论
0
0
加载更多