1616-3张宇(2016.10.31)【连续三十一天总结】
A.文字信息统计100%
B.今天学习了文字信息统计。在群里看了其他同学的学习成果,发现自己学学的速度非常的慢。心里不免有一种紧迫感,可是现在电脑还寄来,用手机敲字实在太慢,等电脑寄回来我会加速补上的。信息统计是将各类不同的字符统计起来。
int main()
{
const int N=101;
char str[N];
int len=0,capital=0,samlletter=0,digital=0,others=0;
int i;
cin.getline(str,N);
i=0;
while(str[i]!=/0)
{len++;
if(str[i]<=“Z”&&str[i]>=“A”)
{
capital++;}
else if
}
while(str[i]!=’\0’){
len++;
while(str[i]!=’\0’{
len++;
}
else if(str[i]<=‘z’&&str[i]>=‘a’{
others++;
}
i++;
}
count<<”字符串总长度:”<<len<<endl;
count<<”大写字母:”<<capital<<endl;
count<<”小写字母:”<<smallletter<<endl;
count<<”数字个数:<<dight<<endl;
return 0;
}
A.文字信息统计100%
B.今天学习了文字信息统计。在群里看了其他同学的学习成果,发现自己学学的速度非常的慢。心里不免有一种紧迫感,可是现在电脑还寄来,用手机敲字实在太慢,等电脑寄回来我会加速补上的。信息统计是将各类不同的字符统计起来。
C.明日任务 string语言的运用
#include <iostream>
using namespace std;int main()
{
const int N=101;
char str[N];
int len=0,capital=0,samlletter=0,digital=0,others=0;
int i;
cin.getline(str,N);
i=0;
while(str[i]!=/0)
{len++;
if(str[i]<=“Z”&&str[i]>=“A”)
{
capital++;}
else if
}
while(str[i]!=’\0’){
len++;
while(str[i]!=’\0’{
len++;
}
else if(str[i]<=‘z’&&str[i]>=‘a’{
others++;
}
i++;
}
count<<”字符串总长度:”<<len<<endl;
count<<”大写字母:”<<capital<<endl;
count<<”小写字母:”<<smallletter<<endl;
count<<”数字个数:<<dight<<endl;
return 0;
}